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

#include <SynchronisationEvent.hh>

Classes

class  ComponentIterator
 

Public Types

using Exception = Diades::Utils::Exception< SynchronisationEvent >
 
using Component = StateMachine
 
using ComponentVector = std::vector< const Component * >
 
using Size = typename ComponentVector::size_type
 
using Event = typename Component::EventPropertyId
 
using EventVector = std::vector< Event >
 

Public Member Functions

 SynchronisationEvent ()=default
 
 SynchronisationEvent (SynchronisationEvent const &other)=default
 
SynchronisationEventoperator= (SynchronisationEvent const &other)=default
 
 SynchronisationEvent (SynchronisationEvent &&other)=default
 
SynchronisationEventoperator= (SynchronisationEvent &&other)=default
 
 ~SynchronisationEvent ()=default
 
 SynchronisationEvent (const ComponentVector &components)
 
 SynchronisationEvent (const SynchronisationEvent &sync1, const SynchronisationEvent &sync2)
 
 SynchronisationEvent (const SynchronisationEvent &sync, const ComponentVector &components)
 
bool operator== (const SynchronisationEvent &evt) const
 
bool operator!= (const SynchronisationEvent &evt) const
 
Size size () const
 
Size supportSize () const
 
bool isValid () const
 
ComponentIterator addEvent (const Component &component, Event e)
 
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
 
Event synchronisedEvent () const
 
void setSynchronisedEvent (Event evt)
 

Static Public Member Functions

static std::string typeName ()
 

Private Types

using NullEvent = typename StateMachine::NullEventPropertyId
 

Private Attributes

ComponentVector _components
 
ComponentVector _support
 
EventVector _events
 
EventVector _supportEvents
 
Event _synchronisedEvent
 

Detailed Description

template<typename StateMachine>
class Diades::Automata::Experimental::SynchronisationEvent< StateMachine >

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.

A SynchronisationEvent is involded in the synchronisation of a set of StateMachine (template). A StateMachine involved in such a Synchronisation is internally called a Component.

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 46 of file SynchronisationEvent.hh.

Member Typedef Documentation

◆ Component

template<typename StateMachine >
Event is the EventPropertyId from the given StateMachine Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::Component

Definition at line 61 of file SynchronisationEvent.hh.

◆ ComponentVector

template<typename StateMachine >
using Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::ComponentVector = std::vector<const Component *>

Definition at line 67 of file SynchronisationEvent.hh.

◆ Event

template<typename StateMachine >
EventVector a vector of Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::Event

Definition at line 77 of file SynchronisationEvent.hh.

◆ EventVector

template<typename StateMachine >
using Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::EventVector = std::vector<Event>

Definition at line 82 of file SynchronisationEvent.hh.

◆ Exception

Definition at line 55 of file SynchronisationEvent.hh.

◆ NullEvent

Definition at line 85 of file SynchronisationEvent.hh.

◆ Size

template<typename StateMachine >
using Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::Size = typename ComponentVector::size_type

Definition at line 72 of file SynchronisationEvent.hh.

Constructor & Destructor Documentation

◆ SynchronisationEvent() [1/6]

template<typename StateMachine >
the Event associated with this Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::SynchronisationEvent ( )
default

Default constructor

If _components[i] has an event involved in the SynchronisationEvent then it is _events[i] otherwise _events[i] is invalid

_supportEvents[i] is the valid event involved in the SynchronisationEvent that is from the component _support[i]

It is set by the user of this SynchronisationEvent

◆ SynchronisationEvent() [2/6]

Copy constructor (default)

Parameters
other

◆ SynchronisationEvent() [3/6]

Move constructor (default)

Parameters
other

◆ ~SynchronisationEvent()

Destructor

◆ SynchronisationEvent() [4/6]

template<typename StateMachine >
Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::SynchronisationEvent ( const ComponentVector components)
inline

Parametrized constructor

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

Definition at line 275 of file SynchronisationEvent.hh.

References ensure, and require.

◆ SynchronisationEvent() [5/6]

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

Definition at line 321 of file SynchronisationEvent.hh.

References Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::beginOfComponents(), Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::endOfComponents(), ensure, Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::getAssociatedEvent(), Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::isValid(), and require.

◆ SynchronisationEvent() [6/6]

template<typename StateMachine >
Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::SynchronisationEvent ( const SynchronisationEvent< StateMachine > &  sync,
const ComponentVector components 
)
inline

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

Definition at line 418 of file SynchronisationEvent.hh.

References ensure, and require.

Member Function Documentation

◆ addEvent()

template<typename StateMachine >
ComponentIterator Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::addEvent ( const Component component,
Event  e 
)
inline
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

Definition at line 562 of file SynchronisationEvent.hh.

References Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::containsEvent(), ensure, Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::ComponentIterator::index(), and require.

◆ beginOfComponents()

template<typename StateMachine >
ComponentIterator Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::beginOfComponents ( ) const
inline
Returns
start iterator on the components of the SynchronisationEvent

Definition at line 609 of file SynchronisationEvent.hh.

Referenced by Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::SynchronisationEvent().

◆ beginOfSupport()

template<typename StateMachine >
ComponentIterator Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::beginOfSupport ( ) const
inline
Returns
start iterator on the support of the SynchronisationEvent

Definition at line 627 of file SynchronisationEvent.hh.

◆ endOfComponents()

template<typename StateMachine >
ComponentIterator Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::endOfComponents ( ) const
inline
Returns
end iterator on the components of the SynchronisationEvent

Definition at line 618 of file SynchronisationEvent.hh.

Referenced by Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::SynchronisationEvent().

◆ endOfSupport()

template<typename StateMachine >
ComponentIterator Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::endOfSupport ( ) const
inline
Returns
end iterator on the support of the SynchronisationEvent

Definition at line 636 of file SynchronisationEvent.hh.

◆ findComponent()

template<typename StateMachine >
ComponentIterator Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::findComponent ( const Component component) const
inline
Returns
an iterator associated to the component in the SynchronisationEvent, endOfComponents() otherwise If the returned iterator 'result' is not endOfComponents() then we ensure that result->getPointer() == component.getPointer()

Definition at line 672 of file SynchronisationEvent.hh.

References Diades::Utils::Ptr< T >::get().

◆ findSupportComponent()

template<typename StateMachine >
ComponentIterator Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::findSupportComponent ( const Component component) const
inline
Returns
an iterator associated to the component in the SynchronisationEvent, endOfSupport() otherwise If the returned iterator 'result' is not endOfSupport() then we ensure that result->getPointer() == component.getPointer()

Definition at line 693 of file SynchronisationEvent.hh.

References Diades::Utils::Ptr< T >::get().

◆ getAssociatedEvent() [1/2]

template<typename StateMachine >
Event Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::getAssociatedEvent ( const ComponentIterator it) const
inline

◆ getAssociatedEvent() [2/2]

template<typename StateMachine >
Event Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::getAssociatedEvent ( const Component comp) const
inline
Returns
the event associated to the component in the SynchronisationEvent if comp is not found the result is undetermined

Definition at line 655 of file SynchronisationEvent.hh.

References require.

◆ isValid()

template<typename StateMachine >
bool Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::isValid ( ) const
inline
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.

Definition at line 505 of file SynchronisationEvent.hh.

Referenced by Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::SynchronisationEvent().

◆ operator!=()

template<typename StateMachine >
bool Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::operator!= ( const SynchronisationEvent< StateMachine > &  evt) const
inline

difference operator

Parameters
evtthe evt to compare with
Returns
true if both events are the same (value equality)

Definition at line 477 of file SynchronisationEvent.hh.

◆ operator=() [1/2]

template<typename StateMachine >
SynchronisationEvent& Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::operator= ( SynchronisationEvent< StateMachine > const &  other)
default

Assignement (default)

Parameters
other
Returns
the current SynchronisationEvent

◆ operator=() [2/2]

template<typename StateMachine >
SynchronisationEvent& Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::operator= ( SynchronisationEvent< StateMachine > &&  other)
default

Move assignement (default)

Parameters
other
Returns
the current Transition

◆ operator==()

template<typename StateMachine >
bool Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::operator== ( const SynchronisationEvent< StateMachine > &  evt) const
inline

◆ setSynchronisedEvent()

template<typename StateMachine >
void Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::setSynchronisedEvent ( Event  evt)
inline

Set the encoded event for this SynchronisationEvent

Parameters
evtthe new encoded event

Definition at line 725 of file SynchronisationEvent.hh.

◆ size()

template<typename StateMachine >
Size Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::size ( ) const
inline
Returns
the number of components involved in this SynchronisationEvent

Definition at line 486 of file SynchronisationEvent.hh.

◆ supportSize()

template<typename StateMachine >
Size Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::supportSize ( ) const
inline
Returns
the number of components involved in the support of this SynchronisationEvent

Definition at line 495 of file SynchronisationEvent.hh.

◆ synchronisedEvent()

template<typename StateMachine >
Event Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::synchronisedEvent ( ) const
inline
Returns
the encoded event for this SynchronisationEvent Note that this event is set by the user with setSynchronisedEvent
See also
setSynchronisedEvent

Definition at line 715 of file SynchronisationEvent.hh.

◆ typeName()

template<typename StateMachine >
static std::string Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::typeName ( )
inlinestatic

Definition at line 51 of file SynchronisationEvent.hh.

Member Data Documentation

◆ _components

template<typename StateMachine >
ComponentVector Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::_components
private

◆ _events

template<typename StateMachine >
EventVector Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::_events
private

◆ _support

template<typename StateMachine >
ComponentVector Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::_support
private

◆ _supportEvents

template<typename StateMachine >
EventVector Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::_supportEvents
private

◆ _synchronisedEvent

template<typename StateMachine >
Event Diades::Automata::Experimental::SynchronisationEvent< StateMachine >::_synchronisedEvent
private

Definition at line 233 of file SynchronisationEvent.hh.


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