UnCoVer (Using Coverability for Verification)
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Private Attributes | List of all members
ExpEnumerator Class Reference

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.
 

Detailed Description

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.

Author
Jan Stückrath

Constructor & Destructor Documentation

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.

Parameters
basethe base of the internal number
exponentthe maximal length of the internal number

Member Function Documentation

bool canCountUp ( )

Returns true, iff the internal number has not reached its maximal value.

Returns
true, iff the internal number is not equal to base^exponent - 1
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.

Returns
the value of the number at the given position
size_t size ( )

Returns the maximal length of the internal number.

Returns
the maximal length of the internal number

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