ponder 3.2
C++ reflection library
ponder::EnumObject Class Reference

Wrapper to manipulate enumerated values in the Ponder system. More...

#include <enumobject.hpp>

Public Member Functions

template<typename T >
 EnumObject (T value, typename std::enable_if< std::is_enum< T >::value >::type *=0)
 Construct the enum object from an enumerated value. More...
 
long value () const
 Get the value of the enum object. More...
 
template<typename E >
value () const
 Get the value of the enum class object. More...
 
IdReturn name () const
 Get the name of the enum object. More...
 
const EnumgetEnum () const
 Retrieve the metaenum of the stored enum object. More...
 
bool operator== (const EnumObject &other) const
 Operator == to compare equality between two enum objects. More...
 
bool operator< (const EnumObject &other) const
 Operator < to compare two enum objects. More...
 

Detailed Description

Wrapper to manipulate enumerated values in the Ponder system.

ponder::EnumObject is an abstract representation of enum values, and supports conversions from strings and integers.

See also
UserObject

Constructor & Destructor Documentation

◆ EnumObject()

template<typename T >
ponder::EnumObject::EnumObject ( value,
typename std::enable_if< std::is_enum< T >::value >::type *  = 0 
)

Construct the enum object from an enumerated value.

Parameters
valueValue to store in the enum object

Member Function Documentation

◆ getEnum()

const Enum& ponder::EnumObject::getEnum ( ) const

Retrieve the metaenum of the stored enum object.

Returns
Reference to the object's metaenum

◆ name()

IdReturn ponder::EnumObject::name ( ) const

Get the name of the enum object.

Returns
String containing the name of the enum object

◆ operator<()

bool ponder::EnumObject::operator< ( const EnumObject other) const

Operator < to compare two enum objects.

Parameters
otherEnum object to compare with this
Returns
True if this < other

◆ operator==()

bool ponder::EnumObject::operator== ( const EnumObject other) const

Operator == to compare equality between two enum objects.

Two enum objects are equal if their metaenums and values are both equal

Parameters
otherEnum object to compare with this
Returns
True if both enum objects are the same, false otherwise

◆ value() [1/2]

long ponder::EnumObject::value ( ) const

Get the value of the enum object.

Returns
Integer value of the enum object

◆ value() [2/2]

template<typename E >
E ponder::EnumObject::value ( ) const

Get the value of the enum class object.

Returns
Enum typed value of the enum class object

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