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

#include <type_reflection.h>

Inherits ddl::DDEnumGenerator< Type >.

Public Types

typedef ddl::DDEnumGenerator< Type > base_type
 

Public Member Functions

 enumeration (const std::string &strName)
 
size_t GetSize () const
 
size_t GetAlignment () const
 
enumerationAdd (const std::string &strName, Type eValue)
 
DDEnumGeneratoraddElement (const std::string &name, Type value)
 Adds a element for the enumeration with name and value.
 
- Public Member Functions inherited from ddl::DDEnumGenerator< Type >
 DDEnumGenerator (const std::string &name, const std::vector< std::pair< std::string, Type > > elements={})
 CTOR.
 
DDEnumGeneratoraddElement (const std::string &name, Type value)
 Adds a element for the enumeration with name and value.
 
 DDEnumGenerator (const std::string &name, const std::vector< std::pair< std::string, Type > > elements={})
 CTOR.
 
DDEnumGeneratoraddElement (const std::string &name, Type value)
 Adds a element for the enumeration with name and value.
 
- Public Member Functions inherited from ddl::DDEnum
 DDEnum ()=delete
 Construct a new DDEnum object.
 
 DDEnum (DDEnum &&)
 Construct a new DDEnum object.
 
DDEnumoperator= (DDEnum &&)
 
 DDEnum (const DDEnum &other)
 Construct a new DDEnum object.
 
DDEnumoperator= (const DDEnum &other)
 copies a DDEnum object
 
 DDEnum (const std::string &name, const dd::DataType &data_type, const std::vector< dd::EnumType::Element > &elements={})
 Construct a new DDEnum object.
 
 DDEnum (const std::string &name, const DDDataType &data_type, const std::vector< dd::EnumType::Element > &elements={})
 Construct a new DDEnum object.
 
DDEnumaddElement (const dd::EnumType::Element &element)
 adds a EnumType element.
 
DDEnumaddElement (const std::string &name, int64_t value)
 adds a EnumType element.
 
DDEnumaddElements (const std::vector< dd::EnumType::Element > &elements)
 adds a vector of EnumType elements.
 
const dd::EnumTypegetEnumType () const
 Get the Enum Type object.
 
const dd::DataDefinitiongetDD () const
 return the valid data definition.
 
size_t getTypeByteSize () const
 returns the size of the underlying datatype.
 
size_t getAlignment () const
 returns the alignment of the underlying datatype.
 

Detailed Description

template<typename Type>
class adtf::mediadescription::enumeration< Type >

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

Example Usage

enum tMyEnum
{
eA = 0,
eB = 1
};
//possibility 1
auto oMyEnumType = enumeration<tMyEnum>("tMyEnum")
.Add("eA", eA)
.Add("eB", eB);
//possibility 2
auto oMyEnumType = enumeration<uint8_t>("tMyEnum")
.Add("eA", 0)
.Add("eB", 1);
enumeration(const std::string &strName)
Definition type_reflection.h:58

Constructor & Destructor Documentation

◆ enumeration()

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

Member Function Documentation

◆ Add()

template<typename Type>
enumeration & adtf::mediadescription::osborn::enumeration< Type >::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.

◆ addElement()

template<typename Type>
DDEnumGenerator & ddl::DDEnumGenerator< Type, void >::addElement ( const std::string & name,
Type value )
inline

Adds a element for the enumeration with name and value.

Parameters
namethe name of the enumeration value
valuethe value for the name out of given type EnumDataType
Returns
DDEnumGenerator& a reference of this

◆ GetAlignment()

template<typename Type>
size_t adtf::mediadescription::osborn::enumeration< Type >::GetAlignment ( ) const
inline

Returns the alignment of the enumeration and underlying data type.

Returns
size_t The alignment

◆ GetSize()

template<typename Type>
size_t adtf::mediadescription::osborn::enumeration< Type >::GetSize ( ) const
inline

Returns the size of the enumeration and underlying data type.

Returns
size_t The size in bytes

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