yasmine
transition_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 TRANSITION_IMPL_9F6CF536_11D2_4F11_B5FB_AB930B935720
13 #define TRANSITION_IMPL_9F6CF536_11D2_4F11_B5FB_AB930B935720
14 
15 
16 #include "transition.hpp"
18 #include "constraint.hpp"
19 #include "behavior.hpp"
20 
21 
22 namespace sxy
23 {
24 
25 
26 class composite_state;
27 
28 
29 class transition_impl SX_FINAL:
30  public virtual transition, public state_machine_element_impl
31 {
32 public:
33  transition_impl( const event_id _event_id, vertex& _source, vertex& _target,
36  transition_impl( const event_ids _event_ids, vertex& _source, vertex& _target,
39  virtual ~transition_impl() SX_NOEXCEPT SX_OVERRIDE;
40  SX_NO_COPY(transition_impl)
41  virtual const vertex& get_source() const SX_OVERRIDE;
42  virtual const vertex& get_target() const SX_OVERRIDE;
43  virtual vertex& get_target() SX_OVERRIDE;
44  virtual const constraint * get_guard() const SX_OVERRIDE;
45  virtual const behavior * get_behavior() const SX_OVERRIDE;
46  virtual sxe::uri get_uri() const SX_OVERRIDE;
47  virtual const state_machine_element * get_parent() const SX_OVERRIDE;
48  virtual sxy::transition_kind get_kind() const SX_OVERRIDE;
49  virtual void add_ancestor_uri( sxe::uri& _uri ) const SX_OVERRIDE;
50  virtual void on_transition_behavior( const event& _event, event_collector& _event_collector ) const SX_OVERRIDE;
51  virtual bool check_guard( const event& _event, event_collector& _event_collector ) const SX_OVERRIDE;
52  virtual bool check( state_machine_defects& _defects ) const SX_OVERRIDE;
53  virtual bool can_accept_event( const event_id _event ) const SX_OVERRIDE;
54 
55 
56 private:
57  static bool check_if_source_and_target_are_in_ancestor_relationship( const vertex& _source,
58  const vertex& _target );
59  static bool check_relationship( const vertex& _lhs, const composite_state* _rhs );
60  static std::string get_transition_name( vertex& _source, vertex& _target, const event_ids& _event_ids );
61  bool check_for_cross_region_transition( state_machine_defects& _defects ) const;
62  bool check_child_parent_relationship_of_source_target_of_transition( state_machine_defects& _defects ) const;
63  bool check_initial_pseudostate( state_machine_defects& _defects ) const;
64  bool check_exit_point( state_machine_defects& _defects ) const;
65 
66  event_ids event_ids_;
67  vertex& source_;
68  vertex& target_;
69  constraint_uptr guard_;
70  behavior_uptr behavior_;
71  transition_kind kind_;
72 };
73 
74 
75 }
76 
77 
78 #endif
std::vector< state_machine_defect > state_machine_defects
Definition: state_machine_defect_fwd.hpp:23
sxe::uint32_t event_id
The type alias for yasmine&#39;s event IDs.
Definition: event_id.hpp:26
Definition: adapter_cpp11.hpp:21
sxe::SX_UNIQUE_PTR< constraint > constraint_uptr
Definition: constraint_fwd.hpp:25
std::vector< event_id > event_ids
The type alias for yasmine&#39;s event ID list.
Definition: event_id.hpp:29
transition_kind
Definition: transition_kind.hpp:25
sxe::SX_UNIQUE_PTR< behavior > behavior_uptr
Definition: behavior_fwd.hpp:25