Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | Private Attributes | List of all members
orxonox::OrxEnum< T > Struct Template Reference

Lightweight enumeration class that can be extended at run time. More...

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/util/OrxEnum.h>

Public Member Functions

constexpr OrxEnum ()
 
constexpr OrxEnum (int type)
 
constexpr OrxEnum (const T &instance)
 
constexpr OrxEnum (const OrxEnum &instance)=delete
 
constexpr operator int () const
 
constexpr bool operator< (const T &right) const
 
T & operator= (int type)
 
constexpr bool operator> (const T &right) const
 

Private Attributes

int type_
 

Detailed Description

template<class T>
struct orxonox::OrxEnum< T >

Lightweight enumeration class that can be extended at run time.

The class accepts type int and also defines operator int(). Therefore int and OrxEnum can be used interchangeably so you can extend the content of the enumeration at run time by adding ints.

Declaring an OrxEnum
Write a struct that inherits OrxEnum and use some macros:
struct MyEnum : OrxEnum<MyEnum>
{
static const int Value1 = -1;
static const int Value2 = 0;
static const int Value3 = Value2 + 10;
};

Constructor & Destructor Documentation

template<class T>
constexpr orxonox::OrxEnum< T >::OrxEnum ( )
inline
template<class T>
constexpr orxonox::OrxEnum< T >::OrxEnum ( int  type)
inline
template<class T>
constexpr orxonox::OrxEnum< T >::OrxEnum ( const T &  instance)
inline
template<class T>
constexpr orxonox::OrxEnum< T >::OrxEnum ( const OrxEnum< T > &  instance)
delete

Member Function Documentation

template<class T>
constexpr orxonox::OrxEnum< T >::operator int ( ) const
inline
template<class T>
constexpr bool orxonox::OrxEnum< T >::operator< ( const T &  right) const
inline
template<class T>
T& orxonox::OrxEnum< T >::operator= ( int  type)
inline
template<class T>
constexpr bool orxonox::OrxEnum< T >::operator> ( const T &  right) const
inline

Member Data Documentation

template<class T>
int orxonox::OrxEnum< T >::type_
private

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