yasmine
event_processing_callback.hpp
Go to the documentation of this file.
1 // //
3 // This file is part of the Seadex yasmine ecosystem (http://yasmine.seadex.de). //
4 // Copyright (C) 2016-2017 Seadex GmbH //
5 // //
6 // Licensing information is available in the folder "license" which is part of this distribution. //
7 // The same information is available on the www @ http://yasmine.seadex.de/Licenses.html. //
8 // //
10 
11 
12 #ifndef EVENT_PROCESSING_CALLBACK_7D1528DE_08BA_4C56_90DF_290C3353040B
13 #define EVENT_PROCESSING_CALLBACK_7D1528DE_08BA_4C56_90DF_290C3353040B
14 
15 
16 #include "essentials/non_copyable.hpp"
17 
18 #include "event_id.hpp"
19 #include "event_priority.hpp"
20 #include "state_fwd.hpp"
21 #include "choice_fwd.hpp"
22 
23 
24 namespace sxy
25 {
26 
27 
28 class state;
29 class transition;
30 class execution_step;
31 class choice;
32 class state_machine_introspection;
33 
38 {
39 public:
41  {
42  // Nothing to do...
43  }
44 
45 
46  virtual ~event_processing_callback() SX_NOEXCEPT
47  {
48  // Nothing to do...
49  }
50 
51 
52  SX_NO_COPY(event_processing_callback)
53 
54 
55  virtual void add_state_machine_introspection( state_machine_introspection& _state_machine ) = 0;
58 
62  virtual void before_event( const event_id _event_id, const event_priority _event_priority = DEFAULT_EVENT_PRIORITY ) = 0;
63 
67  virtual void after_event( const event_id _event_id, const event_priority _event_priority = DEFAULT_EVENT_PRIORITY ) = 0;
68 
71  virtual void before_event_processings_stage() = 0;
72 
76  virtual void after_event_processings_stage( const raw_const_choices& _choices ) = 0;
77 
80  virtual void before_compound_transition() = 0;
81 
84  virtual void after_compound_transition() = 0;
85 
89  virtual void before_exit( const state& _state ) = 0;
90 
94  virtual void after_exit( const state& _state ) = 0;
95 
99  virtual void before_enter( const state& _state ) = 0;
100 
104  virtual void after_enter( const state& _state ) = 0;
105 
109  virtual void before_do( const state& _state ) = 0;
110 
114  virtual void after_do( const state& _state ) = 0;
115 
119  virtual void before_transition( const transition& _transition ) = 0;
120 
124  virtual void after_transition( const transition& _transition ) = 0;
125 };
126 
127 
128 }
129 
130 
131 #endif
virtual void before_compound_transition()=0
Callback before the processing of a compound transition.
sxe::int8_t event_priority
The type alias for yasmine's event priorities.
Definition: event_priority.hpp:26
The interface for state machine introspection. It is inherited by the state machine class state_machi...
Definition: state_machine_introspection.hpp:28
Definition: state.hpp:33
virtual void after_enter(const state &_state)=0
Callback after entering a state.
virtual void after_event(const event_id _event_id, const event_priority _event_priority=DEFAULT_EVENT_PRIORITY)=0
Callback after an event is processed.
sxe::uint32_t event_id
The type alias for yasmine's event IDs.
Definition: event_id.hpp:26
virtual void after_event_processings_stage(const raw_const_choices &_choices)=0
Callback after a event execution stage.
virtual void before_do(const state &_state)=0
Callback before execution of a state behavior ("do behavior").
virtual void before_event(const event_id _event_id, const event_priority _event_priority=DEFAULT_EVENT_PRIORITY)=0
Callback before an event is processed.
virtual void before_enter(const state &_state)=0
Callback before entering a state.
virtual void before_exit(const state &_state)=0
Callback before exiting a state.
virtual void after_do(const state &_state)=0
Callback after execution of a state behavior ("do behavior").
virtual void after_transition(const transition &_transition)=0
Callback after execution of a transition behavior.
virtual ~event_processing_callback() SX_NOEXCEPT
Definition: event_processing_callback.hpp:46
Definition: adapter_cpp11.hpp:21
Callback interface that is called by a state machine during event processing. See the different metho...
Definition: event_processing_callback.hpp:37
event_processing_callback()
Definition: event_processing_callback.hpp:40
constexpr event_priority DEFAULT_EVENT_PRIORITY
yasmine's predefined default event priority.
Definition: event_priority.hpp:42
virtual void after_compound_transition()=0
Callback after the processing of a compound transition.
Definition: transition.hpp:34
std::vector< const choice *> raw_const_choices
Definition: choice_fwd.hpp:28
virtual void before_event_processings_stage()=0
Callback before a event execution stage.
virtual void before_transition(const transition &_transition)=0
Callback before execution of a transition behavior.
virtual void add_state_machine_introspection(state_machine_introspection &_state_machine)=0
Adds a state machine introspection interface.
virtual void after_exit(const state &_state)=0
Callback after exiting a state.