UnCoVer (Using Coverability for Verification)
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
IDtoIDEnumerator.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 IDTOIDENUMERATOR_H_
21 #define IDTOIDENUMERATOR_H_
22 
23 #include "../basic_types/globals.h"
24 #include "../basic_types/InvalidStateException.h"
25 
26 namespace uncover {
27  namespace rule_engine {
28 
38 
39  public:
40 
47  IDtoIDEnumerator(IDType sourceID, unordered_set<IDType> const& targetIDs);
48 
55 
59  virtual ~IDtoIDEnumerator();
60 
67 
71  void reset();
72 
77  bool ended() const;
78 
83  IDType const& getSource() const;
84 
89  IDType const& getTarget() const;
90 
91  private:
92 
97 
101  const IDType source;
102 
106  unordered_set<IDType> const* targets;
107 
111  unordered_set<IDType>::const_iterator iter;
112 
113  };
114 
115  } /* namespace rule_engine */
116 } /* namespace uncover */
117 
118 #endif /* IDTOIDENUMERATOR_H_ */
const IDType source
Stores the ID mapped from.
Definition: IDtoIDEnumerator.h:101
virtual ~IDtoIDEnumerator()
Destroys the current instance of this enumerator.
Definition: IDtoIDEnumerator.cpp:46
This enumerator encapsulates a mapping of an ID to a set of IDs.
Definition: IDtoIDEnumerator.h:37
IDType const & getSource() const
Returns the ID to map from.
Definition: IDtoIDEnumerator.cpp:63
IDType const & getTarget() const
Return the current ID to map to.
Definition: IDtoIDEnumerator.cpp:67
bool ended() const
Returns true iff the enumerator could not retrieve another ID to map to.
Definition: IDtoIDEnumerator.cpp:59
IDtoIDEnumerator & operator++()
Retrieves the next ID to map to, if possible.
Definition: IDtoIDEnumerator.cpp:50
unordered_set< IDType > const * targets
Stores the set of IDs mapped to.
Definition: IDtoIDEnumerator.h:106
unordered_set< IDType >::const_iterator iter
Stores an iterator to the current ID mapped to.
Definition: IDtoIDEnumerator.h:111
void reset()
Resets the enumeration to start from the beginning.
Definition: IDtoIDEnumerator.cpp:55
IDtoIDEnumerator()
This constructor cannot/should not be called.
Definition: IDtoIDEnumerator.cpp:28
unsigned int IDType
IDType is an (unsigned) integer specifically used as an Identifier of graphs, elements of graphs or a...
Definition: globals.h:53