yasmine
composite_state_impl.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 COMPOSITE_STATE_IMPL_2BA1A84B_EF73_4C0C_98B9_F75BA2FF388B
13 #define COMPOSITE_STATE_IMPL_2BA1A84B_EF73_4C0C_98B9_F75BA2FF388B
14 
15 
16 #include "composite_state.hpp"
17 #include "complex_state_impl.hpp"
18 #include "deep_history.hpp"
19 #include "shallow_history.hpp"
20 #include "entry_point.hpp"
21 #include "exit_point.hpp"
22 
23 
24 namespace sxy
25 {
26 
27 
28 class composite_state_impl SX_FINAL:
29  public virtual composite_state, public complex_state_impl
30 {
31 public:
32  explicit composite_state_impl( const std::string& _name, behavior_uptr _entry_action = behavior_uptr(),
33  behavior_uptr _exit_action = behavior_uptr(), const event_ids& _deferred_events = event_ids() );
34  virtual ~composite_state_impl() SX_NOEXCEPT SX_OVERRIDE;
35  SX_NO_COPY(composite_state_impl)
36  virtual region& add_region( region_uptr _region ) SX_OVERRIDE;
37 
41  virtual region& add_region( const std::string& _region_name ) SX_OVERRIDE;
42  virtual const regions& get_regions() const SX_OVERRIDE;
43  virtual regions& get_regions() SX_OVERRIDE;
44  virtual region * get_region( const std::string& _region_name ) const SX_OVERRIDE;
45  bool is_complete() const SX_OVERRIDE;
46 
47  virtual const deep_history * get_deep_history() const SX_OVERRIDE;
48  virtual deep_history& add_deep_history( deep_history_uptr _deep_history ) SX_OVERRIDE;
49 
53  virtual deep_history& add_deep_history( const std::string& _deep_history_name ) SX_OVERRIDE;
54  virtual shallow_history * get_shallow_history() const SX_OVERRIDE;
55  virtual shallow_history& add_shallow_history( shallow_history_uptr _shallow_history ) SX_OVERRIDE;
56 
60  virtual shallow_history& add_shallow_history( const std::string& _shallow_history_name ) SX_OVERRIDE;
61  virtual const raw_const_entry_points get_entry_points() const SX_OVERRIDE;
62  virtual entry_point& add_entry_point( entry_point_uptr _entry_point ) SX_OVERRIDE;
63 
67  virtual entry_point& add_entry_point( const std::string& _entry_point_name ) SX_OVERRIDE;
68  virtual const raw_const_exit_points get_exit_points() const SX_OVERRIDE;
69  virtual exit_point& add_exit_point( exit_point_uptr _exit_point ) SX_OVERRIDE;
70 
74  virtual exit_point& add_exit_point( const std::string& _exit_point_name ) SX_OVERRIDE;
75  virtual vertex * get_pseudostate( const std::string& _name_of_pseudostate ) const SX_OVERRIDE;
76  virtual size_t get_region_index( const region* const _region ) const SX_OVERRIDE;
77  virtual size_t get_parent_region_index() const SX_OVERRIDE;
78  virtual bool check( state_machine_defects& _defects ) const SX_OVERRIDE;
79  virtual void accept_vertex_visitor( const_vertex_visitor& _visitor ) const SX_OVERRIDE;
80  void accept_vertex_visitor( vertex_visitor& _visitor ) SX_OVERRIDE;
81  virtual void accept_complex_state_visitor( complex_state_visitor& _visitor ) const SX_OVERRIDE;
82  virtual void accept_state_visitor( state_visitor& _visitor ) const SX_OVERRIDE;
83  virtual bool is_orthogonal() const SX_OVERRIDE;
84 
85 
86 private:
87  virtual bool check_if_regions_are_completed() const SX_OVERRIDE;
88  static bool regions_are_equal( const region* const _region, const region_uptr& _vector_element_region );
89 
90 
91  regions regions_;
92  deep_history_uptr deep_history_;
93  shallow_history_uptr shallow_history_;
94  entry_points entry_points_;
95  exit_points exit_points_;
96 };
97 
98 
99 }
100 
101 
102 #endif
sxe::SX_UNIQUE_PTR< deep_history > deep_history_uptr
Definition: deep_history_fwd.hpp:25
sxe::SX_UNIQUE_PTR< shallow_history > shallow_history_uptr
Definition: shallow_history_fwd.hpp:23
std::vector< state_machine_defect > state_machine_defects
Definition: state_machine_defect_fwd.hpp:23
std::vector< exit_point_uptr > exit_points
Definition: exit_point_fwd.hpp:27
sxe::SX_UNIQUE_PTR< entry_point > entry_point_uptr
Definition: entry_point_fwd.hpp:25
std::vector< const entry_point *> raw_const_entry_points
Definition: entry_point_fwd.hpp:28
std::vector< entry_point_uptr > entry_points
Definition: entry_point_fwd.hpp:27
sxe::SX_UNIQUE_PTR< exit_point > exit_point_uptr
Definition: exit_point_fwd.hpp:25
sxe::SX_UNIQUE_PTR< region > region_uptr
Definition: region_fwd.hpp:26
Definition: adapter_cpp11.hpp:21
std::vector< region_uptr > regions
Definition: region_fwd.hpp:28
std::vector< const exit_point *> raw_const_exit_points
Definition: exit_point_fwd.hpp:28
std::vector< event_id > event_ids
The type alias for yasmine&#39;s event ID list.
Definition: event_id.hpp:29
sxe::SX_UNIQUE_PTR< behavior > behavior_uptr
Definition: behavior_fwd.hpp:25