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

#include <EventInserter.hh>

Public Types

using EventId = typename Fsm::EventPropertyId
 
using EventMap = std::unordered_map< EventId, EventId >
 
using SourcePtr = typename Diades::Utils::Ptr< Fsm >::ConstP
 
using TargetPtr = typename Diades::Utils::Ptr< Fsm >::P
 

Public Member Functions

 EventInserter ()=default
 
 EventInserter (EventInserter const &other)=default
 
EventInserteroperator= (EventInserter const &other)=default
 
 EventInserter (EventInserter &&other)=default
 
EventInserteroperator= (EventInserter &&other)=default
 
 ~EventInserter ()=default
 
 EventInserter (const Fsm &source, Fsm &target)
 
EventId insertEvent (EventId evt)
 

Protected Member Functions

virtual EventMap::iterator generateEvent (EventId evt)
 

Protected Attributes

SourcePtr _source
 
TargetPtr _target
 
EventMap _eventOf
 

Detailed Description

template<typename Fsm>
class Diades::Automata::Experimental::EventInserter< Fsm >

This class provides a way to insert an Event into a target Fsm from a source Fsm. The way the inserted Event is generated only depends on the generateEvent method. By default, the generateEvent method simply copy the source Event as a target Event. But by deriving EventInserter it is possible to implement other generation policy.

Definition at line 31 of file EventInserter.hh.

Member Typedef Documentation

◆ EventId

template<typename Fsm>
using Diades::Automata::Experimental::EventInserter< Fsm >::EventId = typename Fsm::EventPropertyId

Definition at line 35 of file EventInserter.hh.

◆ EventMap

template<typename Fsm>
using Diades::Automata::Experimental::EventInserter< Fsm >::EventMap = std::unordered_map<EventId, EventId>

Definition at line 36 of file EventInserter.hh.

◆ SourcePtr

template<typename Fsm>
using Diades::Automata::Experimental::EventInserter< Fsm >::SourcePtr = typename Diades::Utils::Ptr<Fsm>::ConstP

Definition at line 37 of file EventInserter.hh.

◆ TargetPtr

template<typename Fsm>
using Diades::Automata::Experimental::EventInserter< Fsm >::TargetPtr = typename Diades::Utils::Ptr<Fsm>::P

Definition at line 38 of file EventInserter.hh.

Constructor & Destructor Documentation

◆ EventInserter() [1/4]

template<typename Fsm>
Diades::Automata::Experimental::EventInserter< Fsm >::EventInserter ( )
default

Default constructor

◆ EventInserter() [2/4]

template<typename Fsm>
Diades::Automata::Experimental::EventInserter< Fsm >::EventInserter ( EventInserter< Fsm > const &  other)
default

Copy constructor (default)

Parameters
other

◆ EventInserter() [3/4]

template<typename Fsm>
Diades::Automata::Experimental::EventInserter< Fsm >::EventInserter ( EventInserter< Fsm > &&  other)
default

Move constructor (default)

Parameters
other

◆ ~EventInserter()

template<typename Fsm>
Diades::Automata::Experimental::EventInserter< Fsm >::~EventInserter ( )
default

Destructor

◆ EventInserter() [4/4]

template<typename Fsm>
Diades::Automata::Experimental::EventInserter< Fsm >::EventInserter ( const Fsm &  source,
Fsm &  target 
)
inline

Build an EventInserter that will be used to insert EventId in target based/associated with EventId from source

Parameters
sourcethe source StateMachine
targetthe target StateMachine

Definition at line 86 of file EventInserter.hh.

Member Function Documentation

◆ generateEvent()

template<typename Fsm>
virtual EventMap::iterator Diades::Automata::Experimental::EventInserter< Fsm >::generateEvent ( EventId  evt)
inlineprotectedvirtual
Parameters
evtan EventId from the source machine generate an EventId associated with evt that will be inserted in the target StateMachine This method should be derived to get other generation policy By default in the root class (EventInserter) the generated event is simply a copy of the EventId evt.

Definition at line 123 of file EventInserter.hh.

Referenced by Diades::Automata::Experimental::EventInserter< _Fsm >::insertEvent().

◆ insertEvent()

template<typename Fsm>
EventId Diades::Automata::Experimental::EventInserter< Fsm >::insertEvent ( EventId  evt)
inline
Parameters
evtan EventId from the source machine
Returns
the inserted eventId associated with evt in the target machine (the insertion is effective only it was not already inserted)

Definition at line 100 of file EventInserter.hh.

◆ operator=() [1/2]

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

Assignement (default)

Parameters
other
Returns
the current EventInserter

◆ operator=() [2/2]

template<typename Fsm>
EventInserter& Diades::Automata::Experimental::EventInserter< Fsm >::operator= ( EventInserter< Fsm > &&  other)
default

Move assignement (default)

Parameters
other
Returns
the current Transition

Member Data Documentation

◆ _eventOf

template<typename Fsm>
EventMap Diades::Automata::Experimental::EventInserter< Fsm >::_eventOf
protected

Definition at line 43 of file EventInserter.hh.

◆ _source

template<typename Fsm>
SourcePtr Diades::Automata::Experimental::EventInserter< Fsm >::_source
protected

Definition at line 41 of file EventInserter.hh.

◆ _target

template<typename Fsm>
TargetPtr Diades::Automata::Experimental::EventInserter< Fsm >::_target
protected

Definition at line 42 of file EventInserter.hh.


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