Dev Essential  1.6.3
Loading...
Searching...
No Matches
ddl::codec::CodecTypeInfo Class Reference

Description of the elements Type. More...

#include <codec_type_info.h>

Public Member Functions

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

Friends

class StructAccess
 

Detailed Description

Description of the elements Type.

Member Function Documentation

◆ getEnumElementName()

const char * ddl::codec::CodecTypeInfo::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 > ddl::codec::CodecTypeInfo::getEnumElementNames ( ) const

Get the Enum Element Names.

Returns
std::vector<std::string>

◆ getEnumElementValue()

a_util::variant::Variant ddl::codec::CodecTypeInfo::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 * ddl::codec::CodecTypeInfo::getLegacyAccessEnumType ( ) const

Legacy Only: Get the Legacy Access Enum Type object.

Returns
const AccessEnumType*

◆ getType()

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

Get the Type.

Returns
ElementType

◆ getTypeName()

const char * ddl::codec::CodecTypeInfo::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 ddl::codec::CodecTypeInfo::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 ddl::codec::CodecTypeInfo::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

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