Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
uavcan::ArrayImpl< T, ArrayMode, MaxSize > Class Template Reference

#include <array.hpp>

Inheritance diagram for uavcan::ArrayImpl< T, ArrayMode, MaxSize >:
Inheritance graph
[legend]

Public Types

enum  { IsStringLike }
 
typedef ValueTypeiterator
 
typedef Base::SizeType SizeType
 
typedef StorageType< T >::Type ValueType
 

Public Member Functions

 ArrayImpl ()
 
ValueTypeat (SizeType pos)
 
const ValueTypeat (SizeType pos) const
 
ValueTypeback ()
 
const ValueTypeback () const
 
ValueTypebegin ()
 
const ValueTypebegin () const
 
const char * c_str () const
 
ValueTypeend ()
 
const ValueTypeend () const
 
ValueTypefront ()
 
const ValueTypefront () const
 
template<typename R >
bool operator< (const R &rhs) const
 
ValueTypeoperator[] (SizeType pos)
 
const ValueTypeoperator[] (SizeType pos) const
 

Public Attributes

const typedef ValueTypeconst_iterator
 

Protected Member Functions

 ~ArrayImpl ()
 

Private Types

typedef Select< ArrayMode==ArrayModeDynamic, DynamicArrayBase< MaxSize >, StaticArrayBase< MaxSize > >::Result Base
 
typedef StorageType< T >::Type BufferType[MaxSize+(IsStringLike ? 1 :0)]
 
typedef ArrayImpl< T, ArrayMode, MaxSize > SelfType
 

Private Member Functions

template<typename >
void initialize (...)
 
template<typename U >
EnableIf< sizeof(U(0) >=U())>::Type initialize (int)
 

Private Attributes

BufferType data_
 

Detailed Description

template<typename T, ArrayMode ArrayMode, unsigned MaxSize>
class uavcan::ArrayImpl< T, ArrayMode, MaxSize >

Common functionality for both static and dynamic arrays. Static arrays are of fixed size; methods that can alter the size (e.g. push_back() and such) will fail to compile. Dynamic arrays contain a fixed-size buffer (it's size is enough to fit maximum number of elements) plus the currently allocated number of elements.

Definition at line 276 of file array.hpp.

Member Typedef Documentation

◆ Base

template<typename T , ArrayMode ArrayMode, unsigned MaxSize>
typedef Select<ArrayMode == ArrayModeDynamic, DynamicArrayBase<MaxSize>, StaticArrayBase<MaxSize> >::Result uavcan::ArrayImpl< T, ArrayMode, MaxSize >::Base
private

Definition at line 281 of file array.hpp.

◆ BufferType

template<typename T , ArrayMode ArrayMode, unsigned MaxSize>
typedef StorageType<T>::Type uavcan::ArrayImpl< T, ArrayMode, MaxSize >::BufferType[MaxSize+(IsStringLike ? 1 :0)]
private

Definition at line 292 of file array.hpp.

◆ iterator

template<typename T , ArrayMode ArrayMode, unsigned MaxSize>
typedef ValueType* uavcan::ArrayImpl< T, ArrayMode, MaxSize >::iterator

Aliases for compatibility with standard containers.

Definition at line 370 of file array.hpp.

◆ SelfType

template<typename T , ArrayMode ArrayMode, unsigned MaxSize>
typedef ArrayImpl<T, ArrayMode, MaxSize> uavcan::ArrayImpl< T, ArrayMode, MaxSize >::SelfType
private

Definition at line 279 of file array.hpp.

◆ SizeType

template<typename T , ArrayMode ArrayMode, unsigned MaxSize>
typedef Base::SizeType uavcan::ArrayImpl< T, ArrayMode, MaxSize >::SizeType

Definition at line 310 of file array.hpp.

◆ ValueType

template<typename T , ArrayMode ArrayMode, unsigned MaxSize>
typedef StorageType<T>::Type uavcan::ArrayImpl< T, ArrayMode, MaxSize >::ValueType

Definition at line 309 of file array.hpp.

Member Enumeration Documentation

◆ anonymous enum

template<typename T , ArrayMode ArrayMode, unsigned MaxSize>
anonymous enum
Enumerator
IsStringLike 

True if the array contents can be interpreted as a 8-bit string (ASCII or UTF8).

Definition at line 284 of file array.hpp.

Constructor & Destructor Documentation

◆ ~ArrayImpl()

template<typename T , ArrayMode ArrayMode, unsigned MaxSize>
uavcan::ArrayImpl< T, ArrayMode, MaxSize >::~ArrayImpl ( )
inlineprotected

Definition at line 306 of file array.hpp.

◆ ArrayImpl()

template<typename T , ArrayMode ArrayMode, unsigned MaxSize>
uavcan::ArrayImpl< T, ArrayMode, MaxSize >::ArrayImpl ( )
inline

Definition at line 315 of file array.hpp.

Member Function Documentation

◆ at() [1/2]

template<typename T , ArrayMode ArrayMode, unsigned MaxSize>
ValueType& uavcan::ArrayImpl< T, ArrayMode, MaxSize >::at ( SizeType  pos)
inline

Range-checking subscript. If the index is out of range:

  • if exceptions are enabled, std::out_of_range will be thrown.
  • if exceptions are disabled and UAVCAN_ASSERT() is enabled, execution will be aborted.
  • if exceptions are disabled and UAVCAN_ASSERT() is disabled, index will be constrained to the closest valid value.

Definition at line 337 of file array.hpp.

◆ at() [2/2]

template<typename T , ArrayMode ArrayMode, unsigned MaxSize>
const ValueType& uavcan::ArrayImpl< T, ArrayMode, MaxSize >::at ( SizeType  pos) const
inline

Definition at line 338 of file array.hpp.

◆ back() [1/2]

template<typename T , ArrayMode ArrayMode, unsigned MaxSize>
ValueType& uavcan::ArrayImpl< T, ArrayMode, MaxSize >::back ( )
inline

Definition at line 355 of file array.hpp.

◆ back() [2/2]

template<typename T , ArrayMode ArrayMode, unsigned MaxSize>
const ValueType& uavcan::ArrayImpl< T, ArrayMode, MaxSize >::back ( ) const
inline

Definition at line 356 of file array.hpp.

◆ begin() [1/2]

template<typename T , ArrayMode ArrayMode, unsigned MaxSize>
ValueType* uavcan::ArrayImpl< T, ArrayMode, MaxSize >::begin ( )
inline

Standard container methods. Applicable to both dynamic and static arrays.

Definition at line 349 of file array.hpp.

◆ begin() [2/2]

template<typename T , ArrayMode ArrayMode, unsigned MaxSize>
const ValueType* uavcan::ArrayImpl< T, ArrayMode, MaxSize >::begin ( ) const
inline

Definition at line 350 of file array.hpp.

◆ c_str()

template<typename T , ArrayMode ArrayMode, unsigned MaxSize>
const char* uavcan::ArrayImpl< T, ArrayMode, MaxSize >::c_str ( ) const
inline

Returns zero-terminated string, same as std::string::c_str(). This method will compile only if the array can be interpreted as 8-bit string (ASCII of UTF8).

Definition at line 321 of file array.hpp.

◆ end() [1/2]

template<typename T , ArrayMode ArrayMode, unsigned MaxSize>
ValueType* uavcan::ArrayImpl< T, ArrayMode, MaxSize >::end ( )
inline

Definition at line 351 of file array.hpp.

◆ end() [2/2]

template<typename T , ArrayMode ArrayMode, unsigned MaxSize>
const ValueType* uavcan::ArrayImpl< T, ArrayMode, MaxSize >::end ( ) const
inline

Definition at line 352 of file array.hpp.

◆ front() [1/2]

template<typename T , ArrayMode ArrayMode, unsigned MaxSize>
ValueType& uavcan::ArrayImpl< T, ArrayMode, MaxSize >::front ( )
inline

Definition at line 353 of file array.hpp.

◆ front() [2/2]

template<typename T , ArrayMode ArrayMode, unsigned MaxSize>
const ValueType& uavcan::ArrayImpl< T, ArrayMode, MaxSize >::front ( ) const
inline

Definition at line 354 of file array.hpp.

◆ initialize() [1/2]

template<typename T , ArrayMode ArrayMode, unsigned MaxSize>
template<typename >
void uavcan::ArrayImpl< T, ArrayMode, MaxSize >::initialize (   ...)
inlineprivate

Definition at line 303 of file array.hpp.

◆ initialize() [2/2]

template<typename T , ArrayMode ArrayMode, unsigned MaxSize>
template<typename U >
EnableIf<sizeof(U(0) >= U())>::Type uavcan::ArrayImpl< T, ArrayMode, MaxSize >::initialize ( int  )
inlineprivate

Definition at line 296 of file array.hpp.

◆ operator<()

template<typename T , ArrayMode ArrayMode, unsigned MaxSize>
template<typename R >
bool uavcan::ArrayImpl< T, ArrayMode, MaxSize >::operator< ( const R &  rhs) const
inline

Performs standard lexicographical compare of the elements.

Definition at line 362 of file array.hpp.

◆ operator[]() [1/2]

template<typename T , ArrayMode ArrayMode, unsigned MaxSize>
ValueType& uavcan::ArrayImpl< T, ArrayMode, MaxSize >::operator[] ( SizeType  pos)
inline

Range-checking subscript. at()

Definition at line 343 of file array.hpp.

◆ operator[]() [2/2]

template<typename T , ArrayMode ArrayMode, unsigned MaxSize>
const ValueType& uavcan::ArrayImpl< T, ArrayMode, MaxSize >::operator[] ( SizeType  pos) const
inline

Definition at line 344 of file array.hpp.

Member Data Documentation

◆ const_iterator

template<typename T , ArrayMode ArrayMode, unsigned MaxSize>
const typedef ValueType* uavcan::ArrayImpl< T, ArrayMode, MaxSize >::const_iterator

Definition at line 371 of file array.hpp.

◆ data_

template<typename T , ArrayMode ArrayMode, unsigned MaxSize>
BufferType uavcan::ArrayImpl< T, ArrayMode, MaxSize >::data_
private

Definition at line 293 of file array.hpp.


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


uavcan_communicator
Author(s):
autogenerated on Fri Dec 13 2024 03:10:04