ADTF
Loading...
Searching...
No Matches
adtf::mediadescription::flash::enumeration< Type, Enable > Class Template Reference

#include <type_reflection_legacy.h>

Inherits adtf::mediadescription::flash::cEnumerationType.

Public Member Functions

 enumeration (const std::string &strName)
 
enumerationAdd (const std::string &strName, Type eValue)
 
- Public Member Functions inherited from adtf::mediadescription::flash::cEnumerationType
 cEnumerationType (const std::string &strName, const std::shared_ptr< cType > &pUnderlyingType)
 
 cEnumerationType (const cEnumerationType &oOther)
 
 ~cEnumerationType () override=default
 
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 adtf::mediadescription::flash::cEnumerationType
void Add (tValue &&sNewValue)
 

Detailed Description

template<typename Type, typename Enable = void>
class adtf::mediadescription::flash::enumeration< Type, Enable >

This is used to create an enumeration ytpe from an existing c++ enum.

Example Usage

enum tMyEnum
{
eA = 0,
eB = 1
};
auto oMyEnumType = enumeration<tMyEnum>("tMyEnum")
.Add("eA", eA)
.Add("eB", eB);
enumeration(const std::string &strName)
Definition type_reflection_legacy.h:227

Constructor & Destructor Documentation

◆ enumeration()

template<typename Type, typename Enable = void>
adtf::mediadescription::flash::enumeration< Type, Enable >::enumeration ( const std::string & strName)
inline
Parameters
[in]strNameThe name of the enumeration.

Member Function Documentation

◆ Add()

template<typename Type, typename Enable = void>
enumeration & adtf::mediadescription::flash::enumeration< Type, Enable >::Add ( const std::string & strName,
Type eValue )
inline

Adds a new mapped value to the enumeration.

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

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