Dev Essential
Loading...
Searching...
No Matches
ddl::codec::FactoryElement< ElementAccessType, ChildElementsType > Class Template Reference

A FactoryElement. More...

#include <codec_iterator.h>

Inherited by ddl::codec::DecoderElement< ElementAccessType, ChildElementsType >.

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
 
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. 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".
 
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. If the element is not an array you get the elements name representation: "element_name".
 
std::string getBaseName () const
 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" .
 
bool isArray () const
 Get array information.
 
bool hasChildren () const
 Get children information.
 
const child_elements_typegetChildElements () const
 Get the ChildElements.
 
self_type getChildElement (std::string_view path) 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
 

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

Member Typedef Documentation

◆ iterator_type

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

allowed iterator type

Constructor & Destructor Documentation

◆ FactoryElement() [1/2]

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

move CTOR

Parameters
otherthe element to move

◆ FactoryElement() [2/2]

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

copy CTOR

Parameters
otherthe element to copy

Member Function Documentation

◆ getArrayElement()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
self_type ddl::codec::FactoryElement< ElementAccessType, ChildElementsType >::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

◆ getArraySize()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
size_t ddl::codec::FactoryElement< ElementAccessType, ChildElementsType >::getArraySize ( ) const
inline

Get the array size.

Returns
size_t

◆ getBaseName()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
std::string ddl::codec::FactoryElement< ElementAccessType, ChildElementsType >::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

◆ getChildElement()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
self_type ddl::codec::FactoryElement< ElementAccessType, ChildElementsType >::getChildElement ( std::string_view path) const
inline

Get the child element with the given name.

Parameters
pathName of the child element.
Returns
self_type

◆ getChildElements()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
const child_elements_type & ddl::codec::FactoryElement< ElementAccessType, ChildElementsType >::getChildElements ( ) const
inline

Get the ChildElements.

Returns
child_elements_type
Exceptions
std::runtime_errorif index is invalid

◆ getFullName()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
std::string ddl::codec::FactoryElement< ElementAccessType, ChildElementsType >::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

◆ getIndex()

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

Get the codec index of the element.

Returns
const CodecIndex&

◆ getName()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
std::string ddl::codec::FactoryElement< ElementAccessType, ChildElementsType >::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

◆ getType()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
ddl::codec::ElementType ddl::codec::FactoryElement< ElementAccessType, ChildElementsType >::getType ( ) const
inline

Get the type of the element.

Returns
ddl::codec::ElementType

◆ hasChildren()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
bool ddl::codec::FactoryElement< ElementAccessType, ChildElementsType >::hasChildren ( ) const
inline

Get children information.

Returns
true has children
false has no children

◆ isArray()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
bool ddl::codec::FactoryElement< ElementAccessType, ChildElementsType >::isArray ( ) const
inline

Get array information.

Returns
true is an array
false is no array

◆ isValid()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
bool ddl::codec::FactoryElement< ElementAccessType, ChildElementsType >::isValid ( ) const
inline

Get validation indormation.

Returns
true is valid
false is not valid

◆ operator=() [1/2]

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

move assignment operator

Parameters
otherthe element to copy
Returns
FactoryElement&

◆ operator=() [2/2]

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
FactoryElement & ddl::codec::FactoryElement< ElementAccessType, ChildElementsType >::operator= ( FactoryElement< ElementAccessType, ChildElementsType > && other)
inline

copy assignment operator

Parameters
otherthe element to move
Returns
FactoryElement&

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