#include <enumerator.h>
Public Member Functions | |
Constructors and Destructors | |
EnumeratorIndex () throw () | |
Default Constructor. | |
template<typename Variant, typename VariantIterator> | |
EnumeratorIndex (const std::list< std::pair< VariantIterator, std::vector< Variant > > > &variant_list) throw () | |
Detailed Constructor. | |
~EnumeratorIndex () throw () | |
Destructor. | |
Assignment | |
const EnumeratorIndex & | operator= (const EnumeratorIndex &rhs) throw () |
Assignment operator. | |
const EnumeratorIndex & | operator= (Position index) throw (Exception::IndexOverflow) |
Assignment operator for Position. | |
template<typename Variant, typename VariantIterator> | |
const EnumeratorIndex & | operator= (const std::list< std::pair< VariantIterator, std::vector< Variant > > > &variant_list) throw () |
Assignment operator for a variant list. | |
Accessors | |
const std::vector< Size > & | getModulus () const throw () |
Access the modulus part of the enumerator. | |
Size | getModulus (Position pos) const throw () |
Access the modulus of a specific position. | |
EnumeratorIndex & | operator++ () throw (Exception::IndexOverflow) |
Increment an instance of EnumeratorIndex. | |
EnumeratorIndex & | operator-- () throw (Exception::IndexUnderflow) |
Decrement an instance of EnumeratorIndex. | |
Position | operator[] (Position pos) const throw () |
Random access operator. | |
Position & | operator[] (Position pos) throw () |
Random access operator. | |
Size | getSize () const throw () |
Return the size of the array. | |
EnumeratorIndex & | operator<< (Size modulus) throw (Exception::OutOfRange) |
Add a new digit. | |
Predicates for EnumeratorIndex class | |
bool | operator== (const EnumeratorIndex &rhs) const throw () |
Equality operator. | |
bool | operator!= (const EnumeratorIndex &rhs) const throw () |
Inequality operator. | |
bool | operator> (const EnumeratorIndex &rhs) const throw (EnumeratorIndex::IncompatibleIndex) |
Greater than operator. | |
bool | operator< (const EnumeratorIndex &rhs) const throw (EnumeratorIndex::IncompatibleIndex) |
Lesser than operator. | |
bool | operator>= (const EnumeratorIndex &rhs) const throw (EnumeratorIndex::IncompatibleIndex) |
Greater or equal operator. | |
bool | operator<= (const EnumeratorIndex &rhs) const throw (EnumeratorIndex::IncompatibleIndex) |
Lesser or equal operator. |
The Enumerator class provides a means for enumerating all possible combinations of objects. The counting is hereby done by the EnumeratorIndex class. This class is derived from vector and additionally contains two vectors of the same size which hold the modulus and the base for each digit. The values of the EnumeratorIndex vector itself are interpreted as an inhomogenous number consisting of digits that have different bases. The bases are the numbers of possibilities for each variant in the list. Most significant component is operator [] (0), so incrementing starts at operator [] (size() - 1)
|
Detailed Constructor.
|
|
Return the size of the array.
|
|
Inequality operator.
|
|
Increment an instance of EnumeratorIndex. Increment the least significant component and apply any overflow to more signficant components. |
|
Decrement an instance of EnumeratorIndex. Decrement the least significant component and apply any underflow to more signficant components. |
|
Lesser than operator.
|
|
Add a new digit. Push the modulus to the ack of the modulus array and initialize the corresponding digit with zero.
|
|
Lesser or equal operator.
|
|
Assignment operator for a variant list.
|
|
Assignment operator for Position.
|
|
Assignment operator.
|
|
Equality operator.
|
|
Greater than operator.
|
|
Greater or equal operator.
|