yasmine
transition_controller.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 TRANSITION_CONTROLLER_FDB88C02_ECF6_4BB5_B99A_3F45813BF357
13 #define TRANSITION_CONTROLLER_FDB88C02_ECF6_4BB5_B99A_3F45813BF357
14 
15 
16 #include "essentials/non_copyable.hpp"
17 
18 #include "choice_fwd.hpp"
20 #include "event_id.hpp"
22 #include "event_fwd.hpp"
23 
24 
25 namespace sxy
26 {
27 
28 
29  class composite_state;
30  class event_processing_callback;
31  class async_event_handler;
32  class event_collector;
33  class interruptible;
34 
35 
36  class transition_controller SX_FINAL
37  {
38  public:
39  transition_controller();
40  ~transition_controller() SX_NOEXCEPT;
41  SX_NO_COPY( transition_controller )
42  static bool process_event( const event& _event, const composite_state& _main_composite_state,
43  event_processing_callback* const _event_processing_callback, bool& _event_is_deferred,
44  async_event_handler* const _async_event_handler, event_collector& _event_collector,
45  const interruptible& _interruptible, bool& _event_was_unhandled );
46  static bool start_state_machine( const composite_state& _main_composite_state,
47  event_processing_callback* const _event_processing_callback, async_event_handler* const _async_event_handler,
48  event_collector& _event_collector, const interruptible& _interruptible );
49 
50 
51  private:
52  static bool execute_transitions( const composite_state& _main_composite_state,
53  compound_transitions& compound_transitions, event_processing_callback* const _event_processing_callback,
54  const event& _event, async_event_handler* const _async_event_handler, event_collector& _event_collector,
55  const interruptible& _interruptible );
56  static void handle_execution_events( events& _exception_events, event_processing_callback* const _event_processing_callback,
57  const composite_state& _main_composite_state, compound_transitions& _compound_transitions,
58  async_event_handler* const _async_event_handler, event_collector& _event_collector,
59  const interruptible& _interruptible );
60  static void search_choice_transitions( const raw_const_choices& _choices,
61  compound_transitions& compound_transitions, const event& _event, event_collector& _event_collector );
62  static void search_completion_event_transitions( const composite_state& _main_composite_state,
63  compound_transitions& compound_transitions, event_collector& _event_collector );
64  };
65 
66 
67 }
68 
69 
70 #endif
std::vector< compound_transition_uptr > compound_transitions
Definition: compound_transition_fwd.hpp:32
Definition: adapter_cpp11.hpp:21
std::vector< const choice *> raw_const_choices
Definition: choice_fwd.hpp:28
std::vector< event_sptr > events
Definition: event_fwd.hpp:27