UnCoVer (Using Coverability for Verification)
|
This enumerator encapsulates a mapping of an ID to a set of IDs. More...
#include <IDtoIDEnumerator.h>
Public Member Functions | |
IDtoIDEnumerator (IDType sourceID, unordered_set< IDType > const &targetIDs) | |
Generates a new IDtoIDEnumerator with the given source ID and target IDs. More... | |
IDtoIDEnumerator (IDtoIDEnumerator &&oldEnum) | |
Move constructor. More... | |
virtual | ~IDtoIDEnumerator () |
Destroys the current instance of this enumerator. | |
IDtoIDEnumerator & | operator++ () |
Retrieves the next ID to map to, if possible. More... | |
void | reset () |
Resets the enumeration to start from the beginning. | |
bool | ended () const |
Returns true iff the enumerator could not retrieve another ID to map to. More... | |
IDType const & | getSource () const |
Returns the ID to map from. More... | |
IDType const & | getTarget () const |
Return the current ID to map to. More... | |
Private Member Functions | |
IDtoIDEnumerator () | |
This constructor cannot/should not be called. | |
Private Attributes | |
const IDType | source |
Stores the ID mapped from. | |
unordered_set< IDType > const * | targets |
Stores the set of IDs mapped to. | |
unordered_set< IDType > ::const_iterator | iter |
Stores an iterator to the current ID mapped to. | |
This enumerator encapsulates a mapping of an ID to a set of IDs.
It is initialized by a source ID and a set of target IDs. After initialization it maps the source ID to one of the target IDs. By incrementing, this mapping can be changed to the next target ID (no order guaranteed). The enumerator ends if every target ID was mapped to exactly once.
IDtoIDEnumerator | ( | IDType | sourceID, |
unordered_set< IDType > const & | targetIDs | ||
) |
Generates a new IDtoIDEnumerator with the given source ID and target IDs.
If the set of target IDs is empty, the enumerator immediately ends.
sourceID | the ID which will me mapped from |
targetIDs | a set of IDs to be mapped to |
IDtoIDEnumerator | ( | IDtoIDEnumerator && | oldEnum | ) |
Move constructor.
Generates a new IDtoIDEnumerator with the data of the old one. The old enumerator is invalidated and will throw exceptions if used again.
oldEnum | the enumerator of which the data will be moved |
bool ended | ( | ) | const |
Returns true iff the enumerator could not retrieve another ID to map to.
const IDType & getSource | ( | ) | const |
Returns the ID to map from.
const IDType & getTarget | ( | ) | const |
Return the current ID to map to.
IDtoIDEnumerator & operator++ | ( | ) |
Retrieves the next ID to map to, if possible.
This operator does nothing if the enumerator has ended.