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

#include <ParametrizedSynchronisation.hh>

Public Types

using Exception = Diades::Utils::Exception< ParametrizedSynchronisation >
 
using SR = SynchronisationRules< StateMachine >
 
using Component = typename SR::Component
 
using SyncEvent = typename SR::SyncEvent
 
using Event = typename SR::Event
 
using ComponentVector = typename SR::ComponentVector
 
using ComponentIterator = typename SR::ComponentIterator
 
using Size = typename SR::Size
 
using SynchronisationList = typename SR::SynchronisationList
 
using SynchronisationIterator = typename SR::SynchronisationIterator
 
- Public Types inherited from Diades::Automata::Experimental::SynchronisationRules< StateMachine >
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

 ParametrizedSynchronisation ()=default
 
 ParametrizedSynchronisation (ParametrizedSynchronisation const &other)=default
 
ParametrizedSynchronisationoperator= (ParametrizedSynchronisation const &other)=default
 
 ParametrizedSynchronisation (ParametrizedSynchronisation &&other)=default
 
ParametrizedSynchronisationoperator= (ParametrizedSynchronisation &&other)=default
 
virtual ~ParametrizedSynchronisation ()=default
 
 ParametrizedSynchronisation (const ComponentVector &components)
 
bool init (const ComponentVector &components)
 
void synchronise (Event e)
 
template<typename ComponentEventIterator >
void synchronise (ComponentEventIterator begin, ComponentEventIterator end)
 
template<typename ComponentEventIterator >
void synchronise (ComponentEventIterator begin, ComponentEventIterator end, bool relaxation)
 
void close ()
 
void open ()
 
bool isLocked () const
 
virtual void clear ()
 
virtual void clearRules ()
 
- Public Member Functions inherited from Diades::Automata::Experimental::SynchronisationRules< StateMachine >
 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)
 
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 ()
 
- Static Public Member Functions inherited from Diades::Automata::Experimental::SynchronisationRules< StateMachine >
static string typeName ()
 

Private Types

using NullEvent = typename StateMachine::NullEventPropertyId
 

Private Attributes

bool _locked
 
std::unordered_map< typename Ptr< Component >::ConstP, std::set< Event > > _isSynchronized
 
const Event _nullEvent = NullEvent().nullValue()
 

Additional Inherited Members

- Protected Attributes inherited from Diades::Automata::Experimental::SynchronisationRules< StateMachine >
ComponentVector _components
 
std::list< SyncEvent_synchros
 

Detailed Description

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

This class allows to setup a customised set of synchronisation rules by successively adding set of events to synchronise. Once the set of events to synchronise is declared, it is required to close the rules. Closing the rules consists in adding the SynchronisationEvent objects that will correspond to the events that are not synchronised (but that are asynchronous and thus must be triggered). In case new events should be synchronised, it is possible to open again but a closure is necessary before using this SynchronisationRules object again.

Definition at line 33 of file ParametrizedSynchronisation.hh.

Member Typedef Documentation

◆ Component

Definition at line 44 of file ParametrizedSynchronisation.hh.

◆ ComponentIterator

Definition at line 48 of file ParametrizedSynchronisation.hh.

◆ ComponentVector

Definition at line 47 of file ParametrizedSynchronisation.hh.

◆ Event

template<typename StateMachine>
using Diades::Automata::Experimental::ParametrizedSynchronisation< StateMachine >::Event = typename SR::Event

Definition at line 46 of file ParametrizedSynchronisation.hh.

◆ Exception

Definition at line 42 of file ParametrizedSynchronisation.hh.

◆ NullEvent

Definition at line 56 of file ParametrizedSynchronisation.hh.

◆ Size

template<typename StateMachine>
using Diades::Automata::Experimental::ParametrizedSynchronisation< StateMachine >::Size = typename SR::Size

Definition at line 49 of file ParametrizedSynchronisation.hh.

◆ SR

Definition at line 43 of file ParametrizedSynchronisation.hh.

◆ SyncEvent

Definition at line 45 of file ParametrizedSynchronisation.hh.

◆ SynchronisationIterator

Definition at line 51 of file ParametrizedSynchronisation.hh.

◆ SynchronisationList

Definition at line 50 of file ParametrizedSynchronisation.hh.

Constructor & Destructor Documentation

◆ ParametrizedSynchronisation() [1/4]

Default constructor

◆ ParametrizedSynchronisation() [2/4]

Copy constructor (default)

Parameters
other

◆ ParametrizedSynchronisation() [3/4]

Move constructor (default)

Parameters
other

◆ ~ParametrizedSynchronisation()

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

Destructor

◆ ParametrizedSynchronisation() [4/4]

Parameters
componentsthe set of components If no synchronise operation is performed but just a closing operation, then generate the free product of components

Definition at line 99 of file ParametrizedSynchronisation.hh.

Member Function Documentation

◆ clear()

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

◆ clearRules()

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

◆ close()

template<typename StateMachine>
void Diades::Automata::Experimental::ParametrizedSynchronisation< StateMachine >::close ( )
inline

◆ init()

template<typename StateMachine>
bool Diades::Automata::Experimental::ParametrizedSynchronisation< StateMachine >::init ( const ComponentVector components)
inline
Parameters
componentsthe set of components If no synchronise operation is performed but just a closing operation, then generate the free product of components
Returns
true if the initialisation is a success

Definition at line 112 of file ParametrizedSynchronisation.hh.

References Diades::Automata::Experimental::ParametrizedSynchronisation< StateMachine >::clear(), and Diades::Automata::Experimental::SynchronisationRules< StateMachine >::setComponentVector().

◆ isLocked()

template<typename StateMachine>
bool Diades::Automata::Experimental::ParametrizedSynchronisation< StateMachine >::isLocked ( ) const
inline

◆ open()

template<typename StateMachine>
void Diades::Automata::Experimental::ParametrizedSynchronisation< StateMachine >::open ( )
inline

when close() is called, it is then not possible to use the synchronise method again until the method open() is called

Definition at line 251 of file ParametrizedSynchronisation.hh.

◆ operator=() [1/2]

Assignement (default)

Parameters
other
Returns
the current ParametrizedSynchronisation

◆ operator=() [2/2]

Move assignement (default)

Parameters
other
Returns
the current ParametrizedSynchronisation

◆ synchronise() [1/3]

template<typename StateMachine>
void Diades::Automata::Experimental::ParametrizedSynchronisation< StateMachine >::synchronise ( Event  e)
inline

◆ synchronise() [2/3]

template<typename StateMachine>
template<typename ComponentEventIterator >
void Diades::Automata::Experimental::ParametrizedSynchronisation< StateMachine >::synchronise ( ComponentEventIterator  begin,
ComponentEventIterator  end 
)
inline
Parameters
beginthe begin iterator on the range of pairs <Component::ConstPointer,Event> (use a map, unordered_map,...)
endthe end iterator on the range of pairs <Component::ConstPointer,Event> (use a map, unordered_map,...) BE AWARE that I will not check whether you attempt to insert the same synchronisation twice! It is your responsability...

Definition at line 165 of file ParametrizedSynchronisation.hh.

References Diades::Automata::Experimental::ParametrizedSynchronisation< StateMachine >::synchronise().

◆ synchronise() [3/3]

template<typename StateMachine>
template<typename ComponentEventIterator >
void Diades::Automata::Experimental::ParametrizedSynchronisation< StateMachine >::synchronise ( ComponentEventIterator  begin,
ComponentEventIterator  end,
bool  relaxation 
)
inline
Parameters
beginthe begin iterator on the range of pairs <Component::ConstPointer,Event> (use a map, unordered_map,...)
endthe end iterator on the range of pairs <Component::ConstPointer,Event> (use a map, unordered_map,...)
relaxationRelaxation mode Add the synchronisation of the transitions labelled with the set of event e in the set of synchronised rules for instance if e = (<comp1,e1>,<comp2,e2>) then a transition from comp1 labelled with e1 will be synchronised with a transition from comp2 labelled with e2. If relaxation mode is set to true, the synchronisation will be relaxed in the sense that transitions from comp1 labelled with e1 will also be triggered asynchronously, similar for transitions e2 from comp2 and (see KanJohn et al, Synthesis of a Distributed and Accurate Diagnoser, DX2010) BE AWARE that I will not check whether you attempt to insert the same synchronisation twice! It is your responsability...

Definition at line 185 of file ParametrizedSynchronisation.hh.

References Diades::Automata::Experimental::SynchronisationRules< StateMachine >::_components, Diades::Automata::Experimental::SynchronisationRules< StateMachine >::_synchros, ensure, Diades::Automata::Experimental::ParametrizedSynchronisation< StateMachine >::isLocked(), Diades::Automata::Experimental::SynchronisationRules< StateMachine >::isValid(), and require.

◆ typeName()

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

Definition at line 38 of file ParametrizedSynchronisation.hh.

Member Data Documentation

◆ _isSynchronized

template<typename StateMachine>
std::unordered_map<typename Ptr<Component>::ConstP, std::set<Event> > Diades::Automata::Experimental::ParametrizedSynchronisation< StateMachine >::_isSynchronized
private

Definition at line 55 of file ParametrizedSynchronisation.hh.

◆ _locked

template<typename StateMachine>
bool Diades::Automata::Experimental::ParametrizedSynchronisation< StateMachine >::_locked
private

◆ _nullEvent

template<typename StateMachine>
const Event Diades::Automata::Experimental::ParametrizedSynchronisation< StateMachine >::_nullEvent = NullEvent().nullValue()
private

Definition at line 57 of file ParametrizedSynchronisation.hh.


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