ADTF  3.18.2
enumeration< UnderlyingType, typename std::enable_if< std::is_arithmetic< UnderlyingType >::value >::type >

This is used to create an enumeration type independently. More...

Inheritance diagram for enumeration< UnderlyingType, typename std::enable_if< std::is_arithmetic< UnderlyingType >::value >::type >:
[legend]

Public Member Functions

 enumeration (const std::string &strName)
 
enumerationAdd (const std::string &strName, int64_t nValue)
 Adds a new mapped value to the enumeration. More...
 
- Public Member Functions inherited from cEnumerationType
 cEnumerationType (const std::string &strName, const std::shared_ptr< cType > &pUnderlyingType)
 Initializes the enumeration with a name and underlying type. More...
 
 cEnumerationType (const cEnumerationType &oOther)
 
std::string GetName () const override
 
size_t GetSize () const override
 
size_t GetAlignment () const override
 
const std::shared_ptr< cType > & GetUnderlyingType () const
 
const std::vector< tValue > & GetValues () const
 

Additional Inherited Members

- Protected Member Functions inherited from cEnumerationType
void Add (tValue &&sNewValue)
 Adds a new mapped value to the enumeration.
 

Detailed Description

template<typename UnderlyingType>
class adtf::mediadescription::flash::enumeration< UnderlyingType, typename std::enable_if< std::is_arithmetic< UnderlyingType >::value >::type >

This is used to create an enumeration type independently.

Example Usage

auto oMyEnumType = enumeration<uint8_t>("tMyEnum")
.Add("eA", 0)
.Add("eB", 1);

Definition at line 236 of file type_reflection_legacy.h.

Constructor & Destructor Documentation

◆ enumeration()

enumeration ( const std::string &  strName)
inline
Parameters
[in]strNameThe name of the enumeration.

Definition at line 243 of file type_reflection_legacy.h.

Member Function Documentation

◆ Add()

enumeration& Add ( const std::string &  strName,
int64_t  nValue 
)
inline

Adds a new mapped value to the enumeration.

Parameters
[in]strNameThe name of the value.
[in]nValueThe value.
Returns
A reference to the enumeration.

Definition at line 255 of file type_reflection_legacy.h.

References cEnumerationType::Add().