vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vrecko::Enumeration< tval, tref > Class Template Reference

#include <Enumeration.h>

Inheritance diagram for vrecko::Enumeration< tval, tref >:
vrecko::Range

Public Member Functions

 Enumeration (unsigned int valuesCount,...)
 
unsigned int valuesCount () const
 
bool containsValue (tref value) const
 
void startIteration ()
 
bool hasNextValue () const
 
tref nextValue ()
 
- Public Member Functions inherited from vrecko::Range
bool isInterval () const
 
bool isEnumeration () const
 

Additional Inherited Members

- Public Types inherited from vrecko::Range
enum  RangeType { RANGE_INTERVAL, RANGE_ENUMERATION }
 
- Protected Member Functions inherited from vrecko::Range
 Range (RangeType rangeType)
 
 Range (const Range &range)
 

Detailed Description

template<class tval, class tref = tval>
class vrecko::Enumeration< tval, tref >

Represents an immutable enumeration.

This class uses templates. Specialized classes are prepared for bool, int, long, float, double and string data types. No other specializations should be used. Specialized classes are listed below definition of this class.

Parameters
tvaldata type used for values storage
trefdata type used for arguments and results passing
See Also
Range
Interval
IntEnumeration
LongEnumeration
FloatEnumeration
DoubleEnumeration
StringEnumeration

Constructor & Destructor Documentation

template<class tval , class tref = tval>
vrecko::Enumeration< tval, tref >::Enumeration ( unsigned int  valuesCount,
  ... 
)
inline

Constructs an Enumeration object by adding all the values.

Parameters
valuesCountnumber of values supplied (should be >= 1)
...values to be inserted

Member Function Documentation

template<class tval , class tref = tval>
bool vrecko::Enumeration< tval, tref >::containsValue ( tref  value) const
inline

"Contains value" predicate.

Parameters
valuevalue to be checked
Returns
true if the value is contained in the enum, false otherwise
template<class tval , class tref = tval>
bool vrecko::Enumeration< tval, tref >::hasNextValue ( ) const
inline

"Has next value" predicate.

You have to initialize the internal interator first by calling startIteration() before you call this method!

Returns
true if there is a next value in the enumeration
See Also
startIteration()
nextValue()
template<class tval , class tref = tval>
tref vrecko::Enumeration< tval, tref >::nextValue ( )
inline

Returns current value and increments the iterator.

You have to initialize the internal interator first by calling startIteration() before you call this method!

Returns
a value pointed to by the internal iterator
See Also
startIteration()
hasNextValue()
template<class tval , class tref = tval>
void vrecko::Enumeration< tval, tref >::startIteration ( )
inline

Initializes the internal iterator.

template<class tval , class tref = tval>
unsigned int vrecko::Enumeration< tval, tref >::valuesCount ( ) const
inline

Returns values count.

Returns
number of values in the enumeration

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