iceoryx2
C++ Language Bindings
Loading...
Searching...
No Matches
iox2::legacy::UninitializedArray< ElementType, Capacity, Buffer > Class Template Referencefinal

Wrapper class for a C-style array of type ElementType and size Capacity. Per default it is uninitialized but all elements can be zeroed via template parameter ZeroedBuffer. More...

#include <uninitialized_array.hpp>

Public Types

using value_type = ElementType
 
using iterator = ElementType *
 
using const_iterator = const ElementType *
 

Public Member Functions

constexpr UninitializedArray () noexcept
 
 UninitializedArray (const UninitializedArray &)=delete
 
 UninitializedArray (UninitializedArray &&)=delete
 
UninitializedArrayoperator= (const UninitializedArray &)=delete
 
UninitializedArrayoperator= (UninitializedArray &&)=delete
 
 ~UninitializedArray ()=default
 
constexpr ElementTypeoperator[] (const uint64_t index) noexcept
 returns a reference to the element stored at index
 
constexpr const ElementTypeoperator[] (const uint64_t index) const noexcept
 returns a const reference to the element stored at index
 
iterator begin () noexcept
 returns an iterator to the beginning of the UninitializedArray
 
const_iterator begin () const noexcept
 returns a const iterator to the beginning of the UninitializedArray
 
iterator end () noexcept
 returns an iterator to the end of the UninitializedArray
 
const_iterator end () const noexcept
 returns a const iterator to the end of the UninitializedArray
 

Static Public Member Functions

static constexpr uint64_t capacity () noexcept
 returns the array capacity
 

Detailed Description

template<typename ElementType, uint64_t Capacity, template< typename, uint64_t > class Buffer = NonZeroedBuffer>
class iox2::legacy::UninitializedArray< ElementType, Capacity, Buffer >

Wrapper class for a C-style array of type ElementType and size Capacity. Per default it is uninitialized but all elements can be zeroed via template parameter ZeroedBuffer.

Template Parameters
ElementTypeis the array type
Capacityis the array size
Bufferis the policy parameter to choose between an uninitialized, not zeroed array (=NonZeroedBuffer, default) and an uninitialized array with all elements zeroed (=ZeroedBuffer)
Note
Out of bounds access leads to undefined behavior

Definition at line 68 of file uninitialized_array.hpp.

Member Typedef Documentation

◆ const_iterator

template<typename ElementType , uint64_t Capacity, template< typename, uint64_t > class Buffer = NonZeroedBuffer>
using iox2::legacy::UninitializedArray< ElementType, Capacity, Buffer >::const_iterator = const ElementType*

Definition at line 74 of file uninitialized_array.hpp.

◆ iterator

Definition at line 73 of file uninitialized_array.hpp.

◆ value_type

Definition at line 72 of file uninitialized_array.hpp.

Constructor & Destructor Documentation

◆ UninitializedArray() [1/3]

template<typename ElementType , uint64_t Capacity, template< typename, uint64_t > class Buffer = NonZeroedBuffer>
constexpr iox2::legacy::UninitializedArray< ElementType, Capacity, Buffer >::UninitializedArray ( )
inlineconstexprnoexcept

Definition at line 80 of file uninitialized_array.hpp.

◆ UninitializedArray() [2/3]

template<typename ElementType , uint64_t Capacity, template< typename, uint64_t > class Buffer = NonZeroedBuffer>
iox2::legacy::UninitializedArray< ElementType, Capacity, Buffer >::UninitializedArray ( const UninitializedArray< ElementType, Capacity, Buffer > &  )
delete

◆ UninitializedArray() [3/3]

template<typename ElementType , uint64_t Capacity, template< typename, uint64_t > class Buffer = NonZeroedBuffer>
iox2::legacy::UninitializedArray< ElementType, Capacity, Buffer >::UninitializedArray ( UninitializedArray< ElementType, Capacity, Buffer > &&  )
delete

◆ ~UninitializedArray()

Member Function Documentation

◆ begin() [1/2]

template<typename ElementType , uint64_t Capacity, template< typename, uint64_t > class Buffer = NonZeroedBuffer>
const_iterator iox2::legacy::UninitializedArray< ElementType, Capacity, Buffer >::begin ( ) const
noexcept

returns a const iterator to the beginning of the UninitializedArray

◆ begin() [2/2]

template<typename ElementType , uint64_t Capacity, template< typename, uint64_t > class Buffer = NonZeroedBuffer>
iterator iox2::legacy::UninitializedArray< ElementType, Capacity, Buffer >::begin ( )
noexcept

returns an iterator to the beginning of the UninitializedArray

◆ capacity()

template<typename ElementType , uint64_t Capacity, template< typename, uint64_t > class Buffer = NonZeroedBuffer>
static constexpr uint64_t iox2::legacy::UninitializedArray< ElementType, Capacity, Buffer >::capacity ( )
staticconstexprnoexcept

returns the array capacity

◆ end() [1/2]

template<typename ElementType , uint64_t Capacity, template< typename, uint64_t > class Buffer = NonZeroedBuffer>
const_iterator iox2::legacy::UninitializedArray< ElementType, Capacity, Buffer >::end ( ) const
noexcept

returns a const iterator to the end of the UninitializedArray

◆ end() [2/2]

template<typename ElementType , uint64_t Capacity, template< typename, uint64_t > class Buffer = NonZeroedBuffer>
iterator iox2::legacy::UninitializedArray< ElementType, Capacity, Buffer >::end ( )
noexcept

returns an iterator to the end of the UninitializedArray

◆ operator=() [1/2]

◆ operator=() [2/2]

◆ operator[]() [1/2]

template<typename ElementType , uint64_t Capacity, template< typename, uint64_t > class Buffer = NonZeroedBuffer>
constexpr const ElementType & iox2::legacy::UninitializedArray< ElementType, Capacity, Buffer >::operator[] ( const uint64_t  index) const
constexprnoexcept

returns a const reference to the element stored at index

Parameters
[in]indexposition of the element to return
Returns
const reference to the element
Note
out of bounds access leads to undefined behavior

◆ operator[]() [2/2]

template<typename ElementType , uint64_t Capacity, template< typename, uint64_t > class Buffer = NonZeroedBuffer>
constexpr ElementType & iox2::legacy::UninitializedArray< ElementType, Capacity, Buffer >::operator[] ( const uint64_t  index)
constexprnoexcept

returns a reference to the element stored at index

Parameters
[in]indexposition of the element to return
Returns
reference to the element
Note
out of bounds access leads to undefined behavior

The documentation for this class was generated from the following file: