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

#include <SynchronisationRules.hh>

Public Types

using Exception = Diades::Utils::Exception< SynchronisationRules >
 
using Component = StateMachine
 
using SyncEvent = SynchronisationEvent< Component >
 
using Event = typename SyncEvent::Event
 
using ComponentVector = typename SyncEvent::ComponentVector
 
using ComponentIterator = typename SyncEvent::ComponentIterator
 
using Size = typename SyncEvent::Size
 
using SynchronisationList = std::list< SyncEvent >
 
using SynchronisationIterator = typename SynchronisationList::iterator
 
using ConstSynchronisationIterator = typename SynchronisationList::const_iterator
 

Public Member Functions

 SynchronisationRules ()=default
 
 SynchronisationRules (SynchronisationRules const &other)=default
 
SynchronisationRulesoperator= (SynchronisationRules const &other)=default
 
 SynchronisationRules (SynchronisationRules &&other)=default
 
SynchronisationRulesoperator= (SynchronisationRules &&other)=default
 
virtual ~SynchronisationRules ()=default
 
 SynchronisationRules (const ComponentVector &components)
 
bool setComponentVector (const ComponentVector &components)
 
virtual void clear ()
 
virtual void clearRules ()
 
ConstSynchronisationIterator beginOfSynchronisedEvents () const
 
ConstSynchronisationIterator endOfSynchronisedEvents () const
 
SynchronisationIterator beginOfSynchronisedEvents ()
 
SynchronisationIterator endOfSynchronisedEvents ()
 
Size numberOfSynchronisedEvents () const
 
Size numberOfComponents () const
 
Size size () const
 
ComponentIterator beginOfComponents () const
 
ComponentIterator endOfComponents () const
 
const ComponentgetComponent (Size index) const
 
ComponentIterator findComponent (const string &name) const
 
ComponentIterator findComponent (const Component &component) const
 
bool operator== (const SynchronisationRules &rules) const
 
void getSynchronisationEvents (const Component &component, Event event, std::list< typename Ptr< SyncEvent >::ConstP > &events) const
 
bool isValid () const
 

Static Public Member Functions

static string typeName ()
 

Protected Attributes

ComponentVector _components
 
std::list< SyncEvent_synchros
 

Detailed Description

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

This class defines a synchronisation law between a set of StateMachine (called here a set of Component's) It is implemented as a list of SynchronisationEvent objects. Off course, the SynchronisationEvent objects must be consistent with each other (same components that are involved). When a composition is performed based on such SynchronisationRules, it means that only synchronised events from this list are triggered. It means, for instance, if an event from a component involved in the SynchronisationEvent objects is not present in at least one of the SynchronisationEvent, then the event cannot occur in the synchronisation, the component cannot trigger it.

The class SynchronisationRules is the most generic one and should never be used. Use the derived classes instead or define new ones that derive from it.

Definition at line 40 of file SynchronisationRules.hh.

Member Typedef Documentation

◆ Component

Definition at line 50 of file SynchronisationRules.hh.

◆ ComponentIterator

Definition at line 54 of file SynchronisationRules.hh.

◆ ComponentVector

Definition at line 53 of file SynchronisationRules.hh.

◆ ConstSynchronisationIterator

template<typename StateMachine>
using Diades::Automata::Experimental::SynchronisationRules< StateMachine >::ConstSynchronisationIterator = typename SynchronisationList::const_iterator

Definition at line 58 of file SynchronisationRules.hh.

◆ Event

template<typename StateMachine>
using Diades::Automata::Experimental::SynchronisationRules< StateMachine >::Event = typename SyncEvent::Event

Definition at line 52 of file SynchronisationRules.hh.

◆ Exception

Definition at line 49 of file SynchronisationRules.hh.

◆ Size

template<typename StateMachine>
using Diades::Automata::Experimental::SynchronisationRules< StateMachine >::Size = typename SyncEvent::Size

Definition at line 55 of file SynchronisationRules.hh.

◆ SyncEvent

Definition at line 51 of file SynchronisationRules.hh.

◆ SynchronisationIterator

template<typename StateMachine>
using Diades::Automata::Experimental::SynchronisationRules< StateMachine >::SynchronisationIterator = typename SynchronisationList::iterator

Definition at line 57 of file SynchronisationRules.hh.

◆ SynchronisationList

Definition at line 56 of file SynchronisationRules.hh.

Constructor & Destructor Documentation

◆ SynchronisationRules() [1/4]

Default constructor

◆ SynchronisationRules() [2/4]

Copy constructor (default)

Parameters
other

◆ SynchronisationRules() [3/4]

Move constructor (default)

Parameters
other

◆ ~SynchronisationRules()

template<typename StateMachine>
virtual Diades::Automata::Experimental::SynchronisationRules< StateMachine >::~SynchronisationRules ( )
virtualdefault

Destructor

◆ SynchronisationRules() [4/4]

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

Parametrized constructor

Parameters
components
Precondition
components must not be empty
components must be all valid pointers and no component must be present twice in components. All the component ids must be different Create the SynchronisationRules based on the components 'components' If the parameters do not comply with the requirements the SynchronisationRules is simply empty. Internally the components will be ordered by their id. So no need to mention that it is required NOT to change any component id while a SynchronisationRules is in use....

Definition at line 110 of file SynchronisationRules.hh.

References Diades::Automata::Experimental::SynchronisationRules< StateMachine >::setComponentVector().

Member Function Documentation

◆ beginOfComponents()

template<typename StateMachine>
ComponentIterator Diades::Automata::Experimental::SynchronisationRules< StateMachine >::beginOfComponents ( ) const
inline

◆ beginOfSynchronisedEvents() [1/2]

template<typename StateMachine>
ConstSynchronisationIterator Diades::Automata::Experimental::SynchronisationRules< StateMachine >::beginOfSynchronisedEvents ( ) const
inline

◆ beginOfSynchronisedEvents() [2/2]

template<typename StateMachine>
SynchronisationIterator Diades::Automata::Experimental::SynchronisationRules< StateMachine >::beginOfSynchronisedEvents ( )
inline
Returns
start iterator on the SynchronisationEvent objects

Definition at line 203 of file SynchronisationRules.hh.

◆ clear()

template<typename StateMachine>
virtual void Diades::Automata::Experimental::SynchronisationRules< StateMachine >::clear ( )
inlinevirtual

◆ clearRules()

template<typename StateMachine>
virtual void Diades::Automata::Experimental::SynchronisationRules< StateMachine >::clearRules ( )
inlinevirtual

◆ endOfComponents()

template<typename StateMachine>
ComponentIterator Diades::Automata::Experimental::SynchronisationRules< StateMachine >::endOfComponents ( ) const
inline

◆ endOfSynchronisedEvents() [1/2]

template<typename StateMachine>
ConstSynchronisationIterator Diades::Automata::Experimental::SynchronisationRules< StateMachine >::endOfSynchronisedEvents ( ) const
inline

◆ endOfSynchronisedEvents() [2/2]

template<typename StateMachine>
SynchronisationIterator Diades::Automata::Experimental::SynchronisationRules< StateMachine >::endOfSynchronisedEvents ( )
inline
Returns
end iterator on the SynchronisationEvent objects

Definition at line 212 of file SynchronisationRules.hh.

◆ findComponent() [1/2]

template<typename StateMachine>
ComponentIterator Diades::Automata::Experimental::SynchronisationRules< StateMachine >::findComponent ( const string &  name) const
inline

◆ findComponent() [2/2]

template<typename StateMachine>
ComponentIterator Diades::Automata::Experimental::SynchronisationRules< StateMachine >::findComponent ( const Component component) const
inline

◆ getComponent()

template<typename StateMachine>
const Component& Diades::Automata::Experimental::SynchronisationRules< StateMachine >::getComponent ( Size  index) const
inline
Parameters
indexan index between 0 and numberOfComponents()-1
Returns

Definition at line 271 of file SynchronisationRules.hh.

References Diades::Automata::Experimental::SynchronisationRules< StateMachine >::numberOfComponents(), and require.

◆ getSynchronisationEvents()

template<typename StateMachine>
void Diades::Automata::Experimental::SynchronisationRules< StateMachine >::getSynchronisationEvents ( const Component component,
Event  event,
std::list< typename Ptr< SyncEvent >::ConstP > &  events 
) const
inline

◆ isValid()

template<typename StateMachine>
bool Diades::Automata::Experimental::SynchronisationRules< StateMachine >::isValid ( ) const
inline

◆ numberOfComponents()

template<typename StateMachine>
Size Diades::Automata::Experimental::SynchronisationRules< StateMachine >::numberOfComponents ( ) const
inline
Returns
the number of components involved in these rules

Definition at line 231 of file SynchronisationRules.hh.

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

◆ numberOfSynchronisedEvents()

template<typename StateMachine>
Size Diades::Automata::Experimental::SynchronisationRules< StateMachine >::numberOfSynchronisedEvents ( ) const
inline
Returns
the number of synchronised events

Definition at line 222 of file SynchronisationRules.hh.

◆ operator=() [1/2]

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

Assignement (default)

Parameters
other
Returns
the current SynchronisationRules

◆ operator=() [2/2]

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

Move assignement (default)

Parameters
other
Returns
the current SynchronisationRules

◆ operator==()

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

◆ setComponentVector()

template<typename StateMachine>
bool Diades::Automata::Experimental::SynchronisationRules< StateMachine >::setComponentVector ( const ComponentVector components)
inline
Parameters
componentsa ComponentVector
Postcondition
initialises this set of rules with the set of components components must be all valid pointers and no component must be present twice in components. All the component ids must be different Create the SynchronisationRules based on the components 'components' If the parameters do not comply with the requirements the SynchronisationRules is simply empty. Internally the components will be ordered by their id. So no need to mention that it is required NOT to change any component id while a SynchronisationRules is in use....
Returns
true the initialisation is a success. False otherwise, if false the structure is cleared.

Definition at line 128 of file SynchronisationRules.hh.

References Diades::Automata::Experimental::SynchronisationRules< StateMachine >::clear().

Referenced by Diades::Automata::Experimental::ParametrizedSynchronisation< StateMachine >::init(), and Diades::Automata::Experimental::SynchronisationRules< StateMachine >::SynchronisationRules().

◆ size()

template<typename StateMachine>
Size Diades::Automata::Experimental::SynchronisationRules< StateMachine >::size ( ) const
inline
Returns
the number of rules (i.e the number SynchronisationEvent objects)

Definition at line 240 of file SynchronisationRules.hh.

◆ typeName()

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

Definition at line 45 of file SynchronisationRules.hh.

Member Data Documentation

◆ _components

template<typename StateMachine>
ComponentVector Diades::Automata::Experimental::SynchronisationRules< StateMachine >::_components
protected

◆ _synchros

template<typename StateMachine>
std::list<SyncEvent> Diades::Automata::Experimental::SynchronisationRules< StateMachine >::_synchros
protected

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