ADTF
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
FactoryElement< ElementAccessType, ChildElementsType >

A FactoryElement. More...

#include <codec_iterator.h>

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
 
FactoryElementoperator= (FactoryElement &&other)
 copy assignment operator
 
 FactoryElement (const FactoryElement &other)
 copy CTOR
 
FactoryElementoperator= (const FactoryElement &other)
 move assignment operator
 
 ~FactoryElement ()=default
 DTOR.
 
const CodecIndexgetIndex () const
 Get the codec index of the element.
 
size_t getArraySize () const
 Get the array size.
 
ddl::codec::ElementType getType () const
 Get the type of the element.
 
std::string getFullName () const
 Get the full name of the element.
 
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] ... etc.
 
std::string getBaseName () const
 Get the base name of the element.
 
bool isArray () const
 Get array information.
 
bool hasChildren () const
 Get children information.
 
const child_elements_typegetChildElements () const
 Get the ChildElements.
 
self_type getChildElement (const std::string &name) const
 Get the child element with the given name.
 
self_type getArrayElement (size_t array_pos=0) const
 Get the array element of the given array_pos.
 
bool isValid () const
 Get validation indormation.
 

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.

Member Typedef Documentation

◆ access_type

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
using access_type = typename ElementAccessType::access_type

access type

Definition at line 545 of file codec_iterator.h.

◆ child_elements_type

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
using child_elements_type = ChildElementsType

allowed container type

Definition at line 546 of file codec_iterator.h.

◆ const_iterator_type

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
using const_iterator_type = typename child_elements_type::const_iterator

allowed const iterator type

Definition at line 549 of file codec_iterator.h.

◆ iterator_type

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
using iterator_type = typename child_elements_type::iterator

allowed iterator type

Definition at line 547 of file codec_iterator.h.

◆ self_type

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
using self_type = FactoryElement<ElementAccessType, ChildElementsType>

self type

Definition at line 544 of file codec_iterator.h.

Constructor & Destructor Documentation

◆ FactoryElement() [1/7]

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
FactoryElement ( FactoryElement< ElementAccessType, ChildElementsType > && other)
inline

move CTOR

Parameters
otherthe element to move

Definition at line 584 of file codec_iterator.h.

◆ FactoryElement() [2/7]

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
FactoryElement ( const FactoryElement< ElementAccessType, ChildElementsType > & other)
inline

copy CTOR

Parameters
otherthe element to copy

Definition at line 606 of file codec_iterator.h.

◆ FactoryElement() [3/7]

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
FactoryElement ( CodecIndex && index,
size_t end_element_index,
size_t child_elements_count,
access_type & access )
inlineprivate

Definition at line 746 of file codec_iterator.h.

◆ FactoryElement() [4/7]

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
FactoryElement ( CodecIndex && index,
size_t end_element_index,
access_type & access )
inlineprivate

Definition at line 756 of file codec_iterator.h.

◆ FactoryElement() [5/7]

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
FactoryElement ( const std::string & element_name,
access_type & access )
inlineprivate

Definition at line 764 of file codec_iterator.h.

◆ FactoryElement() [6/7]

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
FactoryElement ( CodecIndex && index,
access_type & access )
inlineprivate

Definition at line 772 of file codec_iterator.h.

◆ FactoryElement() [7/7]

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
FactoryElement ( access_type & access)
inlineprivate

Definition at line 779 of file codec_iterator.h.

Member Function Documentation

◆ getAccess()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
access_type & getAccess ( ) const
inlineprivate

Definition at line 809 of file codec_iterator.h.

◆ getArrayElement()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
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()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
size_t getArraySize ( ) const
inline

Get the array size.

Returns
size_t

Definition at line 642 of file codec_iterator.h.

◆ getBaseName()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
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()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
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.

◆ getChildElements()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
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.

Referenced by CodecElement< CodecElementAccess< Codec > >::getChildElements().

◆ getFullName()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
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< FactoryElementAccess< const CodecFactory > >::getChildElement().

◆ getIndex()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
const CodecIndex & getIndex ( ) const
inline

Get the codec index of the element.

Returns
const CodecIndex&

Definition at line 634 of file codec_iterator.h.

◆ getName()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
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()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
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.

◆ hasChildren()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
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()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
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.

◆ isValid()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
bool isValid ( ) const
inline

Get validation indormation.

Returns
true is valid
false is not valid

Definition at line 740 of file codec_iterator.h.

◆ next()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
void next ( )
inlineprivate

Definition at line 786 of file codec_iterator.h.

◆ operator=() [1/2]

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
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]

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
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.

◆ resetIndex()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
void resetIndex ( CodecIndex && codec_index)
inlineprivate

Definition at line 814 of file codec_iterator.h.

Member Data Documentation

◆ _access

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
access_type& _access
private

Definition at line 822 of file codec_iterator.h.

◆ _child_elements

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
child_elements_type _child_elements
private

Definition at line 821 of file codec_iterator.h.

◆ _codec_index

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
CodecIndex _codec_index
private

Definition at line 819 of file codec_iterator.h.

◆ _end_element_index

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
size_t _end_element_index
private

Definition at line 820 of file codec_iterator.h.

◆ access_type

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
friend access_type

friend declaration for access_type

Definition at line 566 of file codec_iterator.h.

◆ child_elements_type

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
friend child_elements_type

friend declaration for child_elements_type

Definition at line 554 of file codec_iterator.h.

◆ CodecElement< ElementAccessType, ChildElementsType >

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
friend CodecElement< ElementAccessType, ChildElementsType >

friend declaration for CodecElement

Definition at line 574 of file codec_iterator.h.

◆ const_iterator_type

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
friend const_iterator_type

friend declaration for child_elements_type

Definition at line 562 of file codec_iterator.h.

◆ DecoderElement< ElementAccessType, ChildElementsType >

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
friend DecoderElement< ElementAccessType, ChildElementsType >

friend declaration for DecoderElement

Definition at line 570 of file codec_iterator.h.

◆ iterator_type

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
friend iterator_type

friend declaration for iterator_type

Definition at line 558 of file codec_iterator.h.