UnCoVer (Using Coverability for Verification)
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
ExpEnumerator.h
1 /***************************************************************************
2  * Copyright (C) 2014 by Jan Stückrath <jan.stueckrath@uni-due.de> *
3  * *
4  * This program is free software; you can redistribute it and/or modify *
5  * it under the terms of the GNU General Public License as published by *
6  * the Free Software Foundation; either version 2 of the License, or *
7  * (at your option) any later version. *
8  * *
9  * This program is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12  * GNU General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU General Public License *
15  * along with this program; if not, write to the *
16  * Free Software Foundation, Inc., *
17  * 51 Franklin St, Fifth Floor, Boston, MA 02110, USA *
18  ***************************************************************************/
19 
20 #ifndef EXPENUMERATOR_H_
21 #define EXPENUMERATOR_H_
22 
23 #include <cstddef>
24 
25 namespace uncover {
26  namespace rule_engine {
27 
34  class ExpEnumerator {
35 
36  public:
37 
44  ExpEnumerator(std::size_t base = 0, std::size_t exponent = 0);
45 
49  virtual ~ExpEnumerator();
50 
54  void initialize();
55 
60  bool canCountUp();
61 
66  std::size_t size();
67 
72  void operator++();
73 
78  std::size_t& operator[](std::size_t& index);
79 
80  private:
81 
85  std::size_t dataSize;
86 
90  std::size_t* data;
91 
95  std::size_t base;
96 
97  };
98 
99  } /* namespace rule_engine */
100 } /* namespace uncover */
101 
102 #endif /* EXPENUMERATOR_H_ */
bool canCountUp()
Returns true, iff the internal number has not reached its maximal value.
Definition: ExpEnumerator.cpp:44
ExpEnumerator(std::size_t base=0, std::size_t exponent=0)
Generates an new ExpEnumerator with the given base and exponent.
Definition: ExpEnumerator.cpp:27
virtual ~ExpEnumerator()
Destroys the current instance of ExpEnumerator.
Definition: ExpEnumerator.cpp:34
std::size_t base
The base of the internal number.
Definition: ExpEnumerator.h:95
std::size_t & operator[](std::size_t &index)
Returns the value of the number at the given position.
Definition: ExpEnumerator.cpp:68
std::size_t * data
An array storing the internal number.
Definition: ExpEnumerator.h:90
std::size_t dataSize
The length of the array storing the internal number.
Definition: ExpEnumerator.h:85
void operator++()
Increments the internal number by one.
Definition: ExpEnumerator.cpp:53
This class represents a number over a variable base with a fixed length.
Definition: ExpEnumerator.h:34
std::size_t size()
Returns the maximal length of the internal number.
Definition: ExpEnumerator.cpp:64
void initialize()
Sets the internal number to 0 (the minimal value).
Definition: ExpEnumerator.cpp:38