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

#include <Event.hh>

Public Member Functions

 Event ()
 
 Event (const Event &event)
 
string type () const
 
bool isNull () const
 
bool operator== (const Event &e) const
 
bool operator< (const Event &e) const
 
bool operator> (const Event &e) const
 
size_t id () const
 

Private Member Functions

 Event (const string &type, size_t id)
 

Private Attributes

EventData_data
 

Friends

class EventFactory
 
std::ostream & operator<< (std::ostream &os, const Event &e)
 

Detailed Description

An Event is associated to a Transition of a PetriNet. When a PetriNet fires a Transition, it represents the fact that the associated Event occurs. An Event is an instantaneous event like in the classical discrete-event systems. The type of an Event is just the label of the Event.

Definition at line 82 of file Event.hh.

Constructor & Destructor Documentation

Diades::Petri::Event::Event ( )
inline

Default constructor

Returns
a null Event

Definition at line 90 of file Event.hh.

Diades::Petri::Event::Event ( const string &  type,
size_t  id 
)
inlineprivate

Parameterized constructor

Parameters
typethe type of the event to construct
Returns
an Event whose type is 'type'

Only EventFactory should use this constructor

Definition at line 100 of file Event.hh.

Diades::Petri::Event::Event ( const Event event)
inline

Copy constructor

Parameters
eventan Event
Returns
a copy of the Event (reference copy, not a deep clone)

Definition at line 108 of file Event.hh.

Member Function Documentation

size_t Diades::Petri::Event::id ( ) const
inline
Returns
the internal id of the event
Postcondition
isNull() implies id()==0

Definition at line 156 of file Event.hh.

References Diades::Petri::EventData::id().

Referenced by std::hash< Diades::Petri::Event >::operator()(), and Diades::Petri::PetriNet::setEvent().

bool Diades::Petri::Event::isNull ( ) const
inline
Returns
true if the Event is null

Definition at line 122 of file Event.hh.

Referenced by type().

bool Diades::Petri::Event::operator< ( const Event e) const
inline

Comparison operator

Parameters
ean Event
Returns
true if (*this) is less than e

The comparison operator is used by set, map containers. It is efficient but does not take into account the order of the type

Definition at line 139 of file Event.hh.

References _data.

bool Diades::Petri::Event::operator== ( const Event e) const
inline
Parameters
ean Event
Returns
true is both event are equal (same reference to an EventData)

Definition at line 129 of file Event.hh.

References _data.

bool Diades::Petri::Event::operator> ( const Event e) const
inline

Comparison operator

Parameters
ean Event
Returns
true if (*this) is greater than e

The comparison operator is used by set, map containers. It is efficient but does not take into account the order of the type

Definition at line 149 of file Event.hh.

References _data.

string Diades::Petri::Event::type ( ) const
inline
Returns
the type of the Event
Postcondition
isNull() implies that the result is "Null"

Definition at line 116 of file Event.hh.

References isNull(), and Diades::Petri::EventData::type().

Friends And Related Function Documentation

friend class EventFactory
friend

Definition at line 167 of file Event.hh.

std::ostream& operator<< ( std::ostream &  os,
const Event e 
)
friend
Parameters
osoutput stream
ean Event
Returns
the output stream containing the printable output of the Event e

Definition at line 164 of file Event.hh.

Member Data Documentation

EventData* Diades::Petri::Event::_data
private

Definition at line 84 of file Event.hh.

Referenced by operator<(), operator==(), and operator>().


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