DiaDes  0.1
DIAgnosis of Discrete-Event System
Public Member Functions | Private Attributes | List of all members
Diades::Petri::PetriNet::Iterator Class Reference

Iterator on the PetriNet. More...

#include <PetriNet.hh>

Public Member Functions

 Iterator (list< Arc >::const_iterator it, bool pre)
 
Place operator* () const
 
Iteratoroperator++ ()
 
Iterator operator++ (int)
 
Place operator-> (void) const
 
bool operator== (const Iterator &it) const
 
bool operator!= (const Iterator &it) const
 

Private Attributes

list< Arc >::const_iterator _it
 
bool _pre
 

Detailed Description

Iterator on the PetriNet.

Subclass of the PetriNet class that defines iterators over the Place in the preconditions and postconditions of a Transition items of a PetriNet.

Definition at line 89 of file PetriNet.hh.

Constructor & Destructor Documentation

Diades::Petri::PetriNet::Iterator::Iterator ( list< Arc >::const_iterator  it,
bool  pre 
)
inline

Parameterized constructor

Parameters
ititerator on a list of arcs
preboolean value that states whether the constructed iterator will iterate on the places in the preconditions of a Transition (pre is true) or on the places in the postconditions (pre is false).
Returns
the constructed iterator
Precondition
'it' refers an Arc, if 'pre' is true then 'it->source()' must be a Place if 'pre' is false, 'it->target()' must be a Place
Postcondition
operator-> and operator* returns the Place associated with the Arc refered by 'it'.

Definition at line 106 of file PetriNet.hh.

Member Function Documentation

bool Diades::Petri::PetriNet::Iterator::operator!= ( const Iterator it) const
inline
Parameters
itan Iterator
Returns
true if 'it' is different from the current iterator

Definition at line 176 of file PetriNet.hh.

Place Diades::Petri::PetriNet::Iterator::operator* ( ) const
inline
Returns
the Place pointed by the iterator. It represents either a Place in a postcondition of a Transition or a Place in a precondition of the Transition

Definition at line 115 of file PetriNet.hh.

Iterator& Diades::Petri::PetriNet::Iterator::operator++ ( )
inline
Returns
an iterator on the next Arc

Definition at line 128 of file PetriNet.hh.

Iterator Diades::Petri::PetriNet::Iterator::operator++ ( int  )
inline
Returns
an iterator on the next Arc

Definition at line 138 of file PetriNet.hh.

Place Diades::Petri::PetriNet::Iterator::operator-> ( void  ) const
inline
Returns
the Place pointed by the iterator. It represents either a Place in a postcondition of a Transition or a Place in a precondition of the Transition

Definition at line 151 of file PetriNet.hh.

bool Diades::Petri::PetriNet::Iterator::operator== ( const Iterator it) const
inline
Parameters
itan Iterator
Returns
true if 'it' is equal to the current iterator

Definition at line 165 of file PetriNet.hh.

References _it, and _pre.

Member Data Documentation

list<Arc>::const_iterator Diades::Petri::PetriNet::Iterator::_it
private

Definition at line 92 of file PetriNet.hh.

Referenced by operator==().

bool Diades::Petri::PetriNet::Iterator::_pre
private

Definition at line 93 of file PetriNet.hh.

Referenced by operator==().


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