ML Reference
ml::EnumValues< EnumType > Class Template Reference

Helper class that stores a list of typed enum values and their string names. More...

#include <mlFields.h>

Classes

struct  Entry
 Defines the entry for one enum value. More...
 

Public Member Functions

void add (const char *stringValue, EnumType value)
 Add an enum value, manually passing in the name and value.
 
void add (const std::string &stringValue, EnumType value)
 Add an enum value, manually passing in the name and value.
 
void add (const Entry &value)
 Add an enum value via the given entry, which is typically created with the ML_ENUM_VALUE() macro.
 
EnumValuesoperator<< (const Entry &value)
 Add an enum value via the given entry, which is typically created with the ML_ENUM_VALUE() macro.
 
const std::vector< EnumField::EnumEntry > & getEntries () const
 Get access to the collected list of enum entries.
 

Protected Attributes

std::vector< EnumField::EnumEntry_entries
 

Detailed Description

template<typename EnumType>
class ml::EnumValues< EnumType >

Helper class that stores a list of typed enum values and their string names.

It is used to pass the enum values to the constructor of TypedEnumField<>.

Definition at line 318 of file mlFields.h.

Member Function Documentation

◆ add() [1/3]

template<typename EnumType >
void ml::EnumValues< EnumType >::add ( const char * stringValue,
EnumType value )
inline

Add an enum value, manually passing in the name and value.

Definition at line 334 of file mlFields.h.

◆ add() [2/3]

template<typename EnumType >
void ml::EnumValues< EnumType >::add ( const Entry & value)
inline

Add an enum value via the given entry, which is typically created with the ML_ENUM_VALUE() macro.

Definition at line 344 of file mlFields.h.

References ml::EnumValues< EnumType >::Entry::stringValue, and ml::EnumValues< EnumType >::Entry::value.

◆ add() [3/3]

template<typename EnumType >
void ml::EnumValues< EnumType >::add ( const std::string & stringValue,
EnumType value )
inline

Add an enum value, manually passing in the name and value.

Definition at line 339 of file mlFields.h.

◆ getEntries()

template<typename EnumType >
const std::vector< EnumField::EnumEntry > & ml::EnumValues< EnumType >::getEntries ( ) const
inline

Get access to the collected list of enum entries.

Definition at line 355 of file mlFields.h.

Referenced by ml::TypedEnumField< EnumType >::TypedEnumField().

◆ operator<<()

template<typename EnumType >
EnumValues & ml::EnumValues< EnumType >::operator<< ( const Entry & value)
inline

Add an enum value via the given entry, which is typically created with the ML_ENUM_VALUE() macro.

Definition at line 349 of file mlFields.h.

Member Data Documentation

◆ _entries

template<typename EnumType >
std::vector<EnumField::EnumEntry> ml::EnumValues< EnumType >::_entries
protected

Definition at line 358 of file mlFields.h.


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