DiaDes  0.1
DIAgnosis of Discrete-Event System
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
Diades::Automata::SynchronisationEvent Class Reference

#include <SynchronisationRules.hh>

Public Types

typedef Diades::Utils::Exception< SynchronisationEventException
 
typedef vector< const Component * > ComponentVector
 
typedef vector< EventEventVector
 
typedef ComponentVector::size_type size_type
 
typedef _ComponentIterator ComponentIterator
 
typedef _ComponentIterator SupportIterator
 
typedef const SynchronisationEventConstPointer
 

Public Member Functions

 SynchronisationEvent (const ComponentVector &components)
 
 SynchronisationEvent (const SynchronisationEvent &sync1, const SynchronisationEvent &sync2)
 
 SynchronisationEvent (const SynchronisationEvent &sync, const ComponentVector &components)
 
 SynchronisationEvent (const SynchronisationEvent &sync)
 
SynchronisationEventoperator= (const SynchronisationEvent &sync)
 
ConstPointer getPointer () const
 
size_type size () const
 
size_type supportSize () const
 
bool isValid () const
 
ComponentIterator addEvent (const Component &component, Event e)
 
const EventsynchronisedEvent () const
 
ComponentIterator beginOfComponents () const
 
ComponentIterator endOfComponents () const
 
ComponentIterator beginOfSupport () const
 
ComponentIterator endOfSupport () const
 
Event getAssociatedEvent (const ComponentIterator &it) const
 
Event getAssociatedEvent (const Component &comp) const
 
ComponentIterator findComponent (const Component &component) const
 
ComponentIterator findSupportComponent (const Component &component) const
 
bool operator== (const SynchronisationEvent &sync) const
 

Static Public Member Functions

static string typeName ()
 

Private Member Functions

void updateSynchroniseEvent ()
 

Private Attributes

ComponentVector _components
 
ComponentVector _support
 
EventVector _events
 
EventVector _supportEvents
 
Event _synchronised
 

Detailed Description

A SynchronisationEvent implements a n-uple of events (e_1,....,e_n) that are synchronised according to a law defined in SynchronisationRules. For efficiency purpose, a SynchronisationEvent is associated to a simple Event that represents the t-uple. In the case that the law is not synchronous but asynchronous, the t-uple may contain invalid events that represents the fact that the asssociated component do not trigger any transition when such a SynchronisationEvent occurs. In this case it means that (e_1,....,e_n) contains only a j-uple of valid events namely (e_i1,...,e_ij) associated to a j-uple of components (c_i1,...,c_ij). This j-uple of component is called the support of the SynchronisationEvent. In other words, once the SynchronisationEvent occurs, only the components of the support trigger a transition. A SynchronisationEvent is said to be valid if it has a non-empty support.

Definition at line 121 of file SynchronisationRules.hh.

Member Typedef Documentation

◆ ComponentIterator

Definition at line 131 of file SynchronisationRules.hh.

◆ ComponentVector

Definition at line 128 of file SynchronisationRules.hh.

◆ ConstPointer

Definition at line 133 of file SynchronisationRules.hh.

◆ EventVector

Definition at line 129 of file SynchronisationRules.hh.

◆ Exception

Definition at line 127 of file SynchronisationRules.hh.

◆ size_type

typedef ComponentVector::size_type Diades::Automata::SynchronisationEvent::size_type

Definition at line 130 of file SynchronisationRules.hh.

◆ SupportIterator

Definition at line 132 of file SynchronisationRules.hh.

Constructor & Destructor Documentation

◆ SynchronisationEvent() [1/4]

Diades::Automata::SynchronisationEvent::SynchronisationEvent ( const ComponentVector components)

Parametrized constructor

Parameters
componentsthe components associated in this synchronisation The created event is invalid

◆ SynchronisationEvent() [2/4]

Diades::Automata::SynchronisationEvent::SynchronisationEvent ( const SynchronisationEvent sync1,
const SynchronisationEvent sync2 
)

Merging constructor

Parameters
sync1a SynchronisationEvent (e_1,...,e_m)
sync2a SynchronisationEvent (e'1,...,e'_n) Create a new SynchronisationEvent (e''_1,...,e''{n+m}) resulting from the appending of sync1 and sync2.
Precondition
sync1 and sync2 must be valid
sync1 and sync2 must not contain an event associated to the same component

◆ SynchronisationEvent() [3/4]

Diades::Automata::SynchronisationEvent::SynchronisationEvent ( const SynchronisationEvent sync,
const ComponentVector components 
)

Projection constructor

Parameters
synca SynchronisationEvent
componentsa set of components Create a new SynchronisationEvent by projection of the sync event to the set of components
Precondition
sync must be valid
components must only contains components from sync and moreover it must contain at least one that belongs to the support of sync

◆ SynchronisationEvent() [4/4]

Diades::Automata::SynchronisationEvent::SynchronisationEvent ( const SynchronisationEvent sync)
inline

Copy constructor

Definition at line 179 of file SynchronisationRules.hh.

Member Function Documentation

◆ addEvent()

ComponentIterator Diades::Automata::SynchronisationEvent::addEvent ( const Component component,
Event  e 
)
Parameters
componenta component
ean Event
Returns
an iterator on this association
Precondition
the component must be valid and belongs to the SynchronisationEvent
the event e must be valid and belongs to the component Add the event e associated to the component in the SynchronisationEvent

◆ beginOfComponents()

ComponentIterator Diades::Automata::SynchronisationEvent::beginOfComponents ( ) const
inline
Returns
start iterator on the components of the SynchronisationEvent

Definition at line 248 of file SynchronisationRules.hh.

◆ beginOfSupport()

ComponentIterator Diades::Automata::SynchronisationEvent::beginOfSupport ( ) const
inline
Returns
start iterator on the support of the SynchronisationEvent

Definition at line 262 of file SynchronisationRules.hh.

◆ endOfComponents()

ComponentIterator Diades::Automata::SynchronisationEvent::endOfComponents ( ) const
inline
Returns
end iterator on the components of the SynchronisationEvent

Definition at line 255 of file SynchronisationRules.hh.

◆ endOfSupport()

ComponentIterator Diades::Automata::SynchronisationEvent::endOfSupport ( ) const
inline
Returns
end iterator on the support of the SynchronisationEvent

Definition at line 269 of file SynchronisationRules.hh.

◆ findComponent()

ComponentIterator Diades::Automata::SynchronisationEvent::findComponent ( const Component component) const
Returns
an iterator associated to the component in the SynchronisationEvent, endOfComponents() otherwise
Precondition
component is valid

◆ findSupportComponent()

ComponentIterator Diades::Automata::SynchronisationEvent::findSupportComponent ( const Component component) const
Returns
an iterator associated to the component in the SynchronisationEvent, endOfSupport() otherwise
Precondition
component is valid

◆ getAssociatedEvent() [1/2]

Event Diades::Automata::SynchronisationEvent::getAssociatedEvent ( const ComponentIterator it) const
inline
Returns
the event associated to the iterator

Definition at line 276 of file SynchronisationRules.hh.

References Diades::Automata::_ComponentIterator::getAssociatedEvent().

◆ getAssociatedEvent() [2/2]

Event Diades::Automata::SynchronisationEvent::getAssociatedEvent ( const Component comp) const
inline

◆ getPointer()

ConstPointer Diades::Automata::SynchronisationEvent::getPointer ( ) const
inline
Returns
the pointer on this SynchronisationEvent

Definition at line 199 of file SynchronisationRules.hh.

◆ isValid()

bool Diades::Automata::SynchronisationEvent::isValid ( ) const
Returns
true if the SynchronisationEvent is valid and can be used in a SynchronisationRules object. Be aware that in debug mode the validity checking is not constant but linear in the size of the n-uple. A SynchronisationEvent is said to be valid if its support is not empty.

◆ operator=()

SynchronisationEvent& Diades::Automata::SynchronisationEvent::operator= ( const SynchronisationEvent sync)
inline

Definition at line 185 of file SynchronisationRules.hh.

References _components, _events, _support, _supportEvents, and _synchronised.

◆ operator==()

bool Diades::Automata::SynchronisationEvent::operator== ( const SynchronisationEvent sync) const
Returns
true if both SynchronisationEvent are equal (value equality)

◆ size()

size_type Diades::Automata::SynchronisationEvent::size ( ) const
inline
Returns
the number of components involved in this SynchronisationEvent

Definition at line 206 of file SynchronisationRules.hh.

◆ supportSize()

size_type Diades::Automata::SynchronisationEvent::supportSize ( ) const
inline
Returns
the number of components involved in the support of this SynchronisationEvent

Definition at line 213 of file SynchronisationRules.hh.

◆ synchronisedEvent()

const Event& Diades::Automata::SynchronisationEvent::synchronisedEvent ( ) const
inline
Returns
the synchronised event representing the SynchronisationEvent
Precondition
the SynchronisationEvent is valid
Postcondition
valid event

Definition at line 239 of file SynchronisationRules.hh.

References ensure, Diades::Automata::Event::isValid(), and require.

◆ typeName()

static string Diades::Automata::SynchronisationEvent::typeName ( )
inlinestatic

Definition at line 124 of file SynchronisationRules.hh.

◆ updateSynchroniseEvent()

void Diades::Automata::SynchronisationEvent::updateSynchroniseEvent ( )
private

Update the synchronised event in order to be consistent with the events that have been added. Consistency is set by changing the label of the synchronised event so that it is related to the events of the support that is comp1.e1||...||compn.en

Postcondition
the SynchronisationEvent is valid

Member Data Documentation

◆ _components

ComponentVector Diades::Automata::SynchronisationEvent::_components
private

Definition at line 136 of file SynchronisationRules.hh.

Referenced by operator=().

◆ _events

EventVector Diades::Automata::SynchronisationEvent::_events
private

Definition at line 138 of file SynchronisationRules.hh.

Referenced by operator=().

◆ _support

ComponentVector Diades::Automata::SynchronisationEvent::_support
private

Definition at line 137 of file SynchronisationRules.hh.

Referenced by operator=().

◆ _supportEvents

EventVector Diades::Automata::SynchronisationEvent::_supportEvents
private

Definition at line 139 of file SynchronisationRules.hh.

Referenced by operator=().

◆ _synchronised

Event Diades::Automata::SynchronisationEvent::_synchronised
private

Definition at line 140 of file SynchronisationRules.hh.

Referenced by operator=().


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