ADTF
CodecTypeInfo

Description of the elements Type. More...

Public Member Functions

ElementType getType () const
 Get the Type. More...
 
const char * getTypeName () const
 Get the typename. More...
 
bool isEnum () const
 Determines the value is an enum or not. More...
 
std::vector< std::string > getEnumElementNames () const
 Get the Enum Element Names. More...
 
bool hasEnumElementName (const std::string &name) const
 Determines if the enum element name exists. More...
 
a_util::variant::Variant getEnumElementValue (const std::string &name) const
 Returns the current enum elements value of the given enum element name converted to type T if supported. More...
 
const char * getEnumElementName (const a_util::variant::Variant &value) const
 Returns the enum elements name for the given value if exists. More...
 
const AccessEnumTypegetLegacyAccessEnumType () const
 Legacy Only: Get the Legacy Access Enum Type object. More...
 

Private Member Functions

 CodecTypeInfo (const std::string &type_name, ElementType _element_type)
 
 CodecTypeInfo (const std::string &type_name, ElementType _element_type, AccessEnumType enum_access_type)
 

Private Attributes

ElementType _element_type
 
std::string _type_name
 
AccessEnumType _enum_access_type
 
bool _is_enum
 

Detailed Description

Description of the elements Type.

Definition at line 60 of file codec_type_info.h.

Member Function Documentation

◆ getEnumElementName()

const char* getEnumElementName ( const a_util::variant::Variant value) const

Returns the enum elements name for the given value if exists.

Parameters
[in]valueThe value retrieve the for the value of type T.
Remarks
The pointer of the return value is valid as long as the codec factory created this CodecTypeInfo.
Returns
const char* Returns the enum elements name
Exceptions
throwsstd::runtime_error if not found.

◆ getEnumElementNames()

std::vector<std::string> getEnumElementNames ( ) const

Get the Enum Element Names.

Returns
std::vector<std::string>

◆ getEnumElementValue()

a_util::variant::Variant getEnumElementValue ( const std::string &  name) const

Returns the current enum elements value of the given enum element name converted to type T if supported.

Parameters
[in]nameThe name of the enum element value to retrieve.
Template Parameters
Tthe type to retrieve the value in
Returns
The value in converted to type T
Exceptions
throwsstd::runtime_error if not found.

◆ getLegacyAccessEnumType()

const AccessEnumType* getLegacyAccessEnumType ( ) const

Legacy Only: Get the Legacy Access Enum Type object.

Returns
const AccessEnumType*

◆ getType()

ElementType getType ( ) const

Get the Type.

Returns
ElementType

◆ getTypeName()

const char* getTypeName ( ) const

Get the typename.

Remarks
The pointer of the return value is valid as long as the codec factory created this CodecTypeInfo.
Returns
const char*

◆ hasEnumElementName()

bool hasEnumElementName ( const std::string &  name) const

Determines if the enum element name exists.

Parameters
nameThe name of the enum element
Returns
true the name exists
false the name does not exist

◆ isEnum()

bool isEnum ( ) const

Determines the value is an enum or not.

Remarks
the type (getType) is set to the enums base type defines in ddl.
Returns
true is an enum type
false in not an enum type