ADTF
CodecIndex

Fast Access Index Type for the coders. More...

Classes

class  ElementIndex
 The element index at the CodecIndex. More...
 

Public Member Functions

 CodecIndex ()=default
 Construct a new Codec Index.
 
const ElementIndexoperator[] (size_t pos) const
 Access operator to retrieve a elment index on the given pos. More...
 
bool operator== (const CodecIndex &other) const
 Equal operator. More...
 
bool operator!= (const CodecIndex &other) const
 Not equal operator. More...
 
size_t getSize () const
 Get the Size of the codec index in element index count. More...
 
size_t size () const
 Gets the Size of the codec index in element index count for generic programming. More...
 
bool hasLayout () const
 Has layout set. More...
 
ElementType getType () const
 Get the elements type if CodecIndex is valid. More...
 
const ElementLayoutgetLayout () const
 Get the Layout. More...
 

Private Member Functions

 CodecIndex (const CodecIndex &codec_index, ElementIndex index)
 
 CodecIndex (ElementIndex index)
 
 CodecIndex (const CodecIndex &codec_index, size_t count, ElementIndex index)
 
 CodecIndex (const std::vector< ElementIndex > &indexes)
 
 CodecIndex (ElementIndex index, const ElementLayout &layout)
 
 CodecIndex (const CodecIndex &codec_index, size_t count, ElementIndex index, const ElementLayout &layout)
 
CodecIndexoperator++ ()
 
CodecIndex operator++ (int)
 
void setLayout (const ElementLayout &layout)
 
void addElementIndex (ElementIndex index)
 
CodecIndex::ElementIndex back () const noexcept
 
CodecIndex getIndexForArrayPos (size_t array_pos) const
 

Private Attributes

std::vector< ElementIndex_indices = {}
 
ElementLayout _layout = {}
 
bool _layout_valid = {}
 

Detailed Description

Fast Access Index Type for the coders.

The Codec Index ist a vector of element indexes {{[element_index][array_pos]},{[element_sub_index][array_pos]}} pairs to access the elements of one level in a fast way. You can access leafs and elements at each level.

See also
forEachLeafElement, forEachElement, or the getElements() of each codec or decoder.

Definition at line 132 of file codec_index.h.

Member Function Documentation

◆ getLayout()

◆ getSize()

size_t getSize ( ) const

Get the Size of the codec index in element index count.

Returns
size_t

◆ getType()

◆ hasLayout()

bool hasLayout ( ) const

Has layout set.

Returns
true has valid layout set
false has no valid layout set

◆ operator!=()

bool operator!= ( const CodecIndex other) const

Not equal operator.

Parameters
otherThe codec index to compare.
Returns
true if not equal
false if equal

◆ operator==()

bool operator== ( const CodecIndex other) const

Equal operator.

Parameters
otherThe codec index to compare.
Returns
true if equal
false if not equal

◆ operator[]()

const ElementIndex& operator[] ( size_t  pos) const

Access operator to retrieve a elment index on the given pos.

Parameters
posPosition of the element index to retrieve.
Returns
const ElementIndex&

◆ size()

size_t size ( ) const

Gets the Size of the codec index in element index count for generic programming.

Returns
size_t

Referenced by FactoryElement< ElementAccessType, ChildElementsType >::operator=().