iceoryx2
C++ 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
UninitializedArray & operator= (const UninitializedArray &)=delete
UninitializedArray & operator= (UninitializedArray &&)=delete
 ~UninitializedArray ()=default
constexpr ElementType & operator[] (const uint64_t index) noexcept
 returns a reference to the element stored at index
constexpr const ElementType & operator[] (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

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

Definition at line 73 of file uninitialized_array.hpp.

◆ value_type

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

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>
iox2::legacy::UninitializedArray< ElementType, Capacity, Buffer >::UninitializedArray ( )
inlineconstexprnoexcept

◆ 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

References UninitializedArray().

◆ 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

References UninitializedArray().

◆ ~UninitializedArray()

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

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

References begin().

◆ 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

Referenced by begin().

◆ capacity()

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

returns the array capacity

References capacity().

Referenced by 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

References end().

◆ 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

References end().

Referenced by end(), and end().

◆ operator=() [1/2]

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

References UninitializedArray().

◆ operator=() [2/2]

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

References UninitializedArray().

◆ operator[]() [1/2]

template<typename ElementType, uint64_t Capacity, template< typename, uint64_t > class Buffer = NonZeroedBuffer>
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>
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: