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

This enumerator encapsulates a mapping of an ID to a set of IDs. More...

#include <IDtoIDEnumerator.h>

Collaboration diagram for IDtoIDEnumerator:
Collaboration graph
[legend]

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.
 
IDtoIDEnumeratoroperator++ ()
 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.
 

Detailed Description

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.

Author
Jan Stückrath

Constructor & Destructor Documentation

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.

Parameters
sourceIDthe ID which will me mapped from
targetIDsa set of IDs to be mapped to

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.

Parameters
oldEnumthe enumerator of which the data will be moved

Member Function Documentation

bool ended ( ) const

Returns true iff the enumerator could not retrieve another ID to map to.

Returns
true iff there where no more IDs to map to
const IDType & getSource ( ) const

Returns the ID to map from.

Returns
the ID to map from
const IDType & getTarget ( ) const

Return the current ID to map to.

Returns
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.

Returns
a reference to this enumerator

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