yasmine
state_machine_model.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 #ifndef STATE_MACHINE_MODEL_3F3E9321_9E31_4FE6_AC87_B084AF84F17A
12 #define STATE_MACHINE_MODEL_3F3E9321_9E31_4FE6_AC87_B084AF84F17A
13 
14 #include <vector>
15 
16 #include "essentials/non_copyable.hpp"
17 
18 #include "transition_model_fwd.hpp"
20 #include "event_model.hpp"
21 
22 
23 namespace sxy
24 {
25 
26 
27 namespace model
28 {
29 
30 
34 {
35 public:
36  typedef std::vector< event_model > events;
37 
39  ~state_machine_model() SX_NOEXCEPT;
40  SX_NO_COPY( state_machine_model )
41 
43  void add_transition( transition_model_uptr _transition );
44 
48 
52 
54  void add_root_state( composite_state_model_uptr _root_state );
55 
57  events get_events() const;
58 
62  void add_event( const std::string& _event_name, const event_id& _event_id, const event_priority& _event_priority );
63 
64 
65 private:
66  transition_models transitions_;
67  composite_state_model_uptr root_state_;
68  events event_list_;
69 };
70 
71 
72 }
73 
74 
75 }
76 
77 
78 #endif
state_machine_model()
Definition: state_machine_model.cpp:24
sxe::SX_UNIQUE_PTR< composite_state_model_impl > composite_state_model_uptr
Definition: composite_state_model_fwd.hpp:25
events get_events() const
Get a list of events that was read from JSON file. This events are the events used in this state mach...
Definition: state_machine_model.cpp:72
std::vector< event_model > events
Definition: state_machine_model.hpp:36
~state_machine_model() SX_NOEXCEPT
Definition: state_machine_model.cpp:33
A composite state in the model.
void add_root_state(composite_state_model_uptr _root_state)
Add the root state to the state machine.
Definition: state_machine_model.cpp:66
sxe::uint32_t event_id
The type alias for yasmine model&#39;s event IDs.
Definition: event_model_id.hpp:29
std::vector< const transition_model * > raw_const_transition_models
Definition: transition_model_fwd.hpp:33
raw_const_transition_models get_transitions() const
Get a list of transitions.
Definition: state_machine_model.cpp:45
Definition: algorithm_parameters.hpp:16
void add_transition(transition_model_uptr _transition)
Add a transition to the state machine.
Definition: state_machine_model.cpp:39
Class representing a model of a complete state machine.
Definition: state_machine_model.hpp:33
void add_event(const std::string &_event_name, const event_id &_event_id, const event_priority &_event_priority)
Add an event to the list of the events.
Definition: state_machine_model.cpp:78
sxe::int8_t event_priority
The type alias for yasmine model&#39;s event priorities.
Definition: event_model_priority.hpp:29
std::vector< transition_model_uptr > transition_models
Definition: transition_model_fwd.hpp:32
composite_state_model_impl & get_root_state() const
Get a reference to the root state of the state machine. Reference to the root state of the state mac...
Definition: state_machine_model.cpp:60
sxe::SX_UNIQUE_PTR< transition_model > transition_model_uptr
Definition: transition_model_fwd.hpp:28