Dev Essential
Loading...
Searching...
No Matches
ddl::codec::FactoryElementAccess< AccessType > Class Template Reference

A factory element access type concept template to retrieve element information from the AccessType. This class is to retrieve common information of the element. More...

#include <codec_iterator.h>

Inherited by ddl::codec::DecoderElementAccess< AccessType >.

Public Types

using access_type = AccessType
 The access type (CodecFactory, Codec, Decoder, etc.)
 
using self_type = FactoryElementAccess<AccessType>
 self type
 
using element_type = FactoryElement<self_type, ChildElements<self_type>>
 element type
 

Static Public Member Functions

static element_type getElement (access_type &access, std::string_view full_path)
 Get a element object for the given full_element_name.
 
static element_type getElement (access_type &access, const CodecIndex &index)
 Get a element object for the given index.
 
static element_type getChildElement (access_type &access, const CodecIndex &parent_index, std::string_view relative_path)
 Get a child element object for the given element_name.
 
static size_t getChildCount (access_type &access, const CodecIndex &index)
 Get the Child Count.
 
static std::string getFullName (access_type &access, const CodecIndex &index)
 Get the full name of the element within its main structure. 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".
 
static std::string getName (access_type &access, const CodecIndex &index)
 Get the name of the element within its level structure. 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".
 
static std::string getBaseName (access_type &access, const CodecIndex &index)
 Get the name of the element within its level structure. 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".
 
static void resolve (access_type &access, CodecIndex &index)
 Resolves the given CodecIndex and set the layout information.
 

Detailed Description

template<typename AccessType>
class ddl::codec::FactoryElementAccess< AccessType >

A factory element access type concept template to retrieve element information from the AccessType. This class is to retrieve common information of the element.

See also
FactoryElement.
Template Parameters
AccessTypeThe AccessType for the element (CodecFactory, Codec, Decoder, etc. )

Member Function Documentation

◆ getBaseName()

template<typename AccessType>
static std::string ddl::codec::FactoryElementAccess< AccessType >::getBaseName ( access_type & access,
const CodecIndex & index )
inlinestatic

Get the name of the element within its level structure. 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".

Parameters
accessdefined access type.
indexThe codec index
Returns
std::string

◆ getChildCount()

template<typename AccessType>
static size_t ddl::codec::FactoryElementAccess< AccessType >::getChildCount ( access_type & access,
const CodecIndex & index )
inlinestatic

Get the Child Count.

Parameters
accessdefined access type.
indexThe codec index
Returns
size_t

◆ getChildElement()

template<typename AccessType>
static element_type ddl::codec::FactoryElementAccess< AccessType >::getChildElement ( access_type & access,
const CodecIndex & parent_index,
std::string_view relative_path )
inlinestatic

Get a child element object for the given element_name.

Parameters
accessdefined access type.
parent_indexThe parent codec index.
relative_pathThe name of the element in point notation (i.e. "child_element[4].element_value").
Returns
element_type

◆ getElement() [1/2]

template<typename AccessType>
static element_type ddl::codec::FactoryElementAccess< AccessType >::getElement ( access_type & access,
const CodecIndex & index )
inlinestatic

Get a element object for the given index.

Parameters
accessdefined access type.
indexThe codec index.
Returns
element_type

◆ getElement() [2/2]

template<typename AccessType>
static element_type ddl::codec::FactoryElementAccess< AccessType >::getElement ( access_type & access,
std::string_view full_path )
inlinestatic

Get a element object for the given full_element_name.

Parameters
accessdefined access type.
full_pathThe full name of the element in point notation (i.e. "element1.child_element[4].element_value").
Returns
element_type

◆ getFullName()

template<typename AccessType>
static std::string ddl::codec::FactoryElementAccess< AccessType >::getFullName ( access_type & access,
const CodecIndex & index )
inlinestatic

Get the full name of the element within its main structure. 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".

Parameters
accessdefined access type.
indexThe codec index
Returns
std::string

◆ getName()

template<typename AccessType>
static std::string ddl::codec::FactoryElementAccess< AccessType >::getName ( access_type & access,
const CodecIndex & index )
inlinestatic

Get the name of the element within its level structure. 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".

Parameters
accessdefined access type.
indexThe codec index
Returns
std::string

◆ resolve()

template<typename AccessType>
static void ddl::codec::FactoryElementAccess< AccessType >::resolve ( access_type & access,
CodecIndex & index )
inlinestatic

Resolves the given CodecIndex and set the layout information.

Parameters
accessdefined access type.
indexThe codec index to resolve
Exceptions
throwsif not found

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