UnCoVer (Using Coverability for Verification)
|
This class represents a number over a variable base with a fixed length. More...
#include <ExpEnumerator.h>
Public Member Functions | |
ExpEnumerator (std::size_t base=0, std::size_t exponent=0) | |
Generates an new ExpEnumerator with the given base and exponent. More... | |
virtual | ~ExpEnumerator () |
Destroys the current instance of ExpEnumerator. | |
void | initialize () |
Sets the internal number to 0 (the minimal value). | |
bool | canCountUp () |
Returns true, iff the internal number has not reached its maximal value. More... | |
std::size_t | size () |
Returns the maximal length of the internal number. More... | |
void | operator++ () |
Increments the internal number by one. More... | |
std::size_t & | operator[] (std::size_t &index) |
Returns the value of the number at the given position. More... | |
Private Attributes | |
std::size_t | dataSize |
The length of the array storing the internal number. | |
std::size_t * | data |
An array storing the internal number. | |
std::size_t | base |
The base of the internal number. | |
This class represents a number over a variable base with a fixed length.
It is initialized with a base and an exponent, such that its values can range from 0 to base^exponent - 1. Methods to increment the number and check if increment is possible, are also provided.
ExpEnumerator | ( | std::size_t | base = 0 , |
std::size_t | exponent = 0 |
||
) |
Generates an new ExpEnumerator with the given base and exponent.
No further initialization is necessary.
base | the base of the internal number |
exponent | the maximal length of the internal number |
bool canCountUp | ( | ) |
Returns true, iff the internal number has not reached its maximal value.
void operator++ | ( | ) |
Increments the internal number by one.
If the internal number has reached its maximal value, it is set to 0 instead.
size_t & operator[] | ( | std::size_t & | index | ) |
Returns the value of the number at the given position.
Least significant bit has the index 0.
size_t size | ( | ) |
Returns the maximal length of the internal number.