ADTF
FactoryElement< ElementAccessType, ChildElementsType >

A FactoryElement. More...

Inheritance diagram for FactoryElement< ElementAccessType, ChildElementsType >:
[legend]

Public Types

using self_type = FactoryElement< ElementAccessType, ChildElementsType >
 self type
 
using access_type = typename ElementAccessType::access_type
 access type
 
using child_elements_type = ChildElementsType
 allowed container type
 
using iterator_type = typename child_elements_type::iterator
 allowed iterator type
 
using const_iterator_type = typename child_elements_type::const_iterator
 allowed const iterator type
 

Public Member Functions

 FactoryElement ()=delete
 no CTOR
 
 FactoryElement (FactoryElement &&other)
 move CTOR More...
 
FactoryElementoperator= (FactoryElement &&other)
 copy assignment operator More...
 
 FactoryElement (const FactoryElement &other)
 copy CTOR More...
 
FactoryElementoperator= (const FactoryElement &other)
 move assignment operator More...
 
 ~FactoryElement ()=default
 DTOR.
 
const CodecIndexgetIndex () const
 Get the codec index of the element. More...
 
size_t getArraySize () const
 Get the array size. More...
 
ddl::codec::ElementType getType () const
 Get the type of the element. More...
 
std::string getFullName () const
 Get the full name of the element. More...
 
std::string getName () const
 Get the name of the element If the element is an array you get the elements array name representation: "element_name[0]" or element_name[1] ... More...
 
std::string getBaseName () const
 Get the base name of the element. More...
 
bool isArray () const
 Get array information. More...
 
bool hasChildren () const
 Get children information. More...
 
const child_elements_typegetChildElements () const
 Get the ChildElements. More...
 
self_type getChildElement (const std::string &name) const
 Get the child element with the given name. More...
 
self_type getArrayElement (size_t array_pos=0) const
 Get the array element of the given array_pos. More...
 
bool isValid () const
 Get validation indormation. More...
 

Public Attributes

friend child_elements_type
 friend declaration for child_elements_type
 
friend iterator_type
 friend declaration for iterator_type
 
friend const_iterator_type
 friend declaration for child_elements_type
 
friend access_type
 friend declaration for access_type
 
friend DecoderElement< ElementAccessType, ChildElementsType >
 friend declaration for DecoderElement
 
friend CodecElement< ElementAccessType, ChildElementsType >
 friend declaration for CodecElement
 

Private Member Functions

 FactoryElement (CodecIndex &&index, size_t end_element_index, size_t child_elements_count, access_type &access)
 
 FactoryElement (CodecIndex &&index, size_t end_element_index, access_type &access)
 
 FactoryElement (const std::string &element_name, access_type &access)
 
 FactoryElement (CodecIndex &&index, access_type &access)
 
 FactoryElement (access_type &access)
 
void next ()
 
access_typegetAccess () const
 
void resetIndex (CodecIndex &&codec_index)
 

Private Attributes

CodecIndex _codec_index
 
size_t _end_element_index
 
child_elements_type _child_elements
 
access_type_access
 

Detailed Description

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
class ddl::codec::FactoryElement< ElementAccessType, ChildElementsType >

A FactoryElement.

Template Parameters
ElementAccessTypeThe element access concept type. (see concept templates FactoryElementAccess, DecoderElementAccess, CodecElementAccess)
ChildElementsTypeThe child elements type

Definition at line 542 of file codec_iterator.h.

Constructor & Destructor Documentation

◆ FactoryElement() [1/2]

FactoryElement ( FactoryElement< ElementAccessType, ChildElementsType > &&  other)
inline

move CTOR

Parameters
otherthe element to move

Definition at line 584 of file codec_iterator.h.

◆ FactoryElement() [2/2]

FactoryElement ( const FactoryElement< ElementAccessType, ChildElementsType > &  other)
inline

copy CTOR

Parameters
otherthe element to copy

Definition at line 606 of file codec_iterator.h.

Member Function Documentation

◆ getArrayElement()

self_type getArrayElement ( size_t  array_pos = 0) const
inline

Get the array element of the given array_pos.

Parameters
array_posThe array pos of the element to retrieve
Returns
self_type

Definition at line 731 of file codec_iterator.h.

◆ getArraySize()

size_t getArraySize ( ) const
inline

Get the array size.

Returns
size_t

Definition at line 642 of file codec_iterator.h.

References ElementLayoutBase::array_size, and CodecIndex::getLayout().

◆ getBaseName()

std::string getBaseName ( ) const
inline

Get the base name of the element.

If the element is an array you get the elements base name representation : "element_name" for each array element. If the element is not an array you get the elements name representation is also the base name representation: "element_name" .

Returns
std::string

Definition at line 683 of file codec_iterator.h.

◆ getChildElement()

self_type getChildElement ( const std::string &  name) const
inline

Get the child element with the given name.

Parameters
nameName of the child element.
Returns
self_type

Definition at line 719 of file codec_iterator.h.

References FactoryElement< ElementAccessType, ChildElementsType >::getFullName().

◆ getChildElements()

const child_elements_type& getChildElements ( ) const
inline

Get the ChildElements.

Returns
child_elements_type
Exceptions
std::runtime_errorif index is invalid

Definition at line 710 of file codec_iterator.h.

◆ getFullName()

std::string getFullName ( ) const
inline

Get the full name of the element.

If the element is an array you get the elements array name representation: "main_element.element_name[0]" or main_element.element_name[1] ... etc. If the element is not an array you get the elements name representation: "main_element.element_name".

Returns
std::string

Definition at line 661 of file codec_iterator.h.

Referenced by FactoryElement< ElementAccessType, ChildElementsType >::getChildElement(), and DecoderElement< ElementAccessType, ChildElementsType >::getChildElement().

◆ getIndex()

◆ getName()

std::string getName ( ) const
inline

Get the name of the element If the element is an array you get the elements array name representation: "element_name[0]" or element_name[1] ...

etc. If the element is not an array you get the elements name representation: "element_name".

Returns
std::string

Definition at line 672 of file codec_iterator.h.

◆ getType()

ddl::codec::ElementType getType ( ) const
inline

Get the type of the element.

Returns
ddl::codec::ElementType

Definition at line 650 of file codec_iterator.h.

References CodecIndex::getType().

◆ hasChildren()

bool hasChildren ( ) const
inline

Get children information.

Returns
true has children
false has no children

Definition at line 701 of file codec_iterator.h.

◆ isArray()

bool isArray ( ) const
inline

Get array information.

Returns
true is an array
false is no array

Definition at line 692 of file codec_iterator.h.

References ElementLayoutBase::array_size, and CodecIndex::getLayout().

◆ isValid()

bool isValid ( ) const
inline

Get validation indormation.

Returns
true is valid
false is not valid

Definition at line 740 of file codec_iterator.h.

◆ operator=() [1/2]

FactoryElement& operator= ( const FactoryElement< ElementAccessType, ChildElementsType > &  other)
inline

move assignment operator

Parameters
otherthe element to copy
Returns
FactoryElement&

Definition at line 618 of file codec_iterator.h.

◆ operator=() [2/2]

FactoryElement& operator= ( FactoryElement< ElementAccessType, ChildElementsType > &&  other)
inline

copy assignment operator

Parameters
otherthe element to move
Returns
FactoryElement&

Definition at line 596 of file codec_iterator.h.

References CodecIndex::size().