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

This enumerator can be used to enumerate all equivalences on IDs, where the equivalence closure of the enumerated IDPartition and a predefined IDPartition is the IDPartition, where every ID is in the same partition. More...

#include <IDClosureEnumerator.h>

Collaboration diagram for IDClosureEnumerator:
Collaboration graph
[legend]

Public Member Functions

 IDClosureEnumerator (unordered_set< IDType > const &idSet, basic_types::IDPartition const &partition)
 Generates a new IDClosureEnumerator for the given ID set and the given partition. More...
 
 IDClosureEnumerator (IDClosureEnumerator &&oldEnum)
 Move constructor. More...
 
virtual ~IDClosureEnumerator ()
 Destroys this instance of the enumerator.
 
bool isValid () const
 Returns whether the enumerator is still valid or not. More...
 
bool ended () const
 Return whether the enumerator has ended, i.e. More...
 
void reset ()
 Resets the computation of this enumerator, such that it will enumerate partitions beginning with the first again. More...
 
IDClosureEnumeratoroperator++ ()
 Computes the next valid IDPartition. More...
 
basic_types::IDPartition const & operator* () const
 Return the last computed IDPartition. More...
 

Private Member Functions

void throwIfNotValid () const
 Checks if the enumerator is valid and throws an exception if it is not.
 

Private Attributes

basic_types::IDPartitionEnumeratorenumerator
 Stores an enumerator to enumerate all possible IDPartitions.
 
const basic_types::IDPartitionotherPart
 Stores the partition with which the equivalence closure will be formed.
 
bool finished
 Stores whether the enumerator finished its computation or not.
 

Friends

std::ostream & operator<< (std::ostream &ost, IDClosureEnumerator const &data)
 Prints the most important contents of the given IDClosureEnumerator. More...
 

Detailed Description

This enumerator can be used to enumerate all equivalences on IDs, where the equivalence closure of the enumerated IDPartition and a predefined IDPartition is the IDPartition, where every ID is in the same partition.

See Also
IDPartition
IDPartitionEnumerator
Author
Jan Stückrath

Constructor & Destructor Documentation

IDClosureEnumerator ( unordered_set< IDType > const &  idSet,
basic_types::IDPartition const &  partition 
)

Generates a new IDClosureEnumerator for the given ID set and the given partition.

All enumerated partitions will be partitions on the given ID set. Every partition on the given ID set will be enumerated, if the equivalence closure of it and the given partition relates all its elements.

Parameters
idSetthe set of IDs for which partitions will be enumerated
partitionthe partition with which the closure with the enumerated partition will be formed

Move constructor.

Moves all computations and results of the given enumerator to this new enumerator, while invalidating the given enumerator. Calling functions of the old enumerator will probably throw exceptions.

Parameters
oldEnumthe enumerator from which data will be (re)moved from

Member Function Documentation

bool ended ( ) const

Return whether the enumerator has ended, i.e.

the last IDPartition was enumerated. Throws an exception if enumerator is not valid.

Returns
true iff the last IDPartition was enumerated
bool isValid ( ) const

Returns whether the enumerator is still valid or not.

An IDClosureEnumerator is invalidated only by a call of the move constructor.

Returns
true iff the enumerator is valid
const IDPartition & operator* ( ) const

Return the last computed IDPartition.

Throws an exception if enumerator is not valid.

Returns
the last computed IDPartition
IDClosureEnumerator & operator++ ( )

Computes the next valid IDPartition.

Throws an exception if enumerator is not valid.

Returns
a reference to this enumerator
void reset ( )

Resets the computation of this enumerator, such that it will enumerate partitions beginning with the first again.

Throws an exception if enumerator is not valid.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  ost,
IDClosureEnumerator const &  data 
)
friend

Prints the most important contents of the given IDClosureEnumerator.

Parameters
ostthe stream to which the data will be printed
datathe enumerator which should be printed
Returns
a reference to the used stream

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