yasmine
state.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 STATE_A72D37CD_D9B1_430D_BBCA_13371745FC80
13 #define STATE_A72D37CD_D9B1_430D_BBCA_13371745FC80
14 
15 
16 #include "vertex.hpp"
17 #include "state_fwd.hpp"
18 #include "region_fwd.hpp"
19 #include "event_fwd.hpp"
20 
21 
22 namespace sxy
23 {
24 
25 
26 class state_visitor;
27 class behavior;
28 class event;
29 class async_event_handler;
30 class event_collector;
31 
32 
33 class state:
34  public virtual vertex
35 {
36 public:
38  {
39  // Nothing to do...
40  }
41 
42 
43  virtual ~state() SX_NOEXCEPT SX_OVERRIDE
44  {
45  // Nothing to do...
46  }
47 
48 
49  SX_NO_COPY(state)
50  virtual void set_parent_region( region* const _parent_region ) = 0;
51  virtual region * get_parent_region() const = 0;
52  virtual size_t get_parent_region_index() const = 0;
53  virtual region * get_region( const std::string& _region_name ) const = 0;
54  virtual vertex * get_pseudostate( const std::string& _name_of_pseudostate ) const = 0;
55  virtual behavior * get_entry_behavior() const = 0;
56  virtual behavior * get_exit_behavior() const = 0;
57  virtual std::size_t get_nesting_level() const = 0;
58  virtual void set_active() = 0;
59  virtual void set_inactive() = 0;
60  virtual bool is_active() const = 0;
61  virtual bool is_complete() const = 0;
62  virtual bool is_event_deferred( const event_id& _event_id ) const = 0;
63  virtual bool was_active() const = 0;
64  virtual void set_was_active() = 0;
65  virtual const regions& get_regions() const = 0;
66  virtual regions& get_regions() = 0;
67  virtual void execute_do_behavior( const event& _event, async_event_handler* const _async_event_handler,
68  event_collector& _event_collector ) const = 0;
69  virtual void execute_enter_behavior( const event& _event, event_collector& _event_collector ) const = 0;
70  virtual void execute_exit_behavior( const event& _event, event_collector& _event_collector ) const = 0;
71  virtual void accept_state_visitor( state_visitor& _visitor ) const = 0;
72  virtual void enter_state( const event& _event, event_collector& _event_collector ) = 0;
73  virtual void exit_state( const event& _event, event_collector& _event_collector ) = 0;
74  virtual bool has_error_event() const = 0;
75  virtual event_sptr get_error_event() const = 0;
76 };
77 
78 
79 }
80 
81 
82 #endif
virtual void set_inactive()=0
Definition: event_collector.hpp:25
Definition: state.hpp:33
virtual size_t get_parent_region_index() const =0
virtual event_sptr get_error_event() const =0
virtual const regions & get_regions() const =0
sxe::uint32_t event_id
The type alias for yasmine's event IDs.
Definition: event_id.hpp:26
state()
Definition: state.hpp:37
virtual region * get_parent_region() const =0
virtual bool is_complete() const =0
Definition: region.hpp:42
Interface of an event. An event has an ID, a name and a priority (for processing by the async state m...
Definition: event.hpp:28
virtual void set_was_active()=0
virtual void set_active()=0
virtual void set_parent_region(region *const _parent_region)=0
virtual bool is_active() const =0
virtual bool was_active() const =0
Definition: async_event_handler.hpp:22
Definition: adapter_cpp11.hpp:21
virtual std::size_t get_nesting_level() const =0
virtual void execute_enter_behavior(const event &_event, event_collector &_event_collector) const =0
std::vector< region_uptr > regions
Definition: region_fwd.hpp:28
virtual vertex * get_pseudostate(const std::string &_name_of_pseudostate) const =0
virtual region * get_region(const std::string &_region_name) const =0
virtual void execute_do_behavior(const event &_event, async_event_handler *const _async_event_handler, event_collector &_event_collector) const =0
Definition: vertex.hpp:36
Definition: behavior.hpp:26
virtual void execute_exit_behavior(const event &_event, event_collector &_event_collector) const =0
virtual behavior * get_entry_behavior() const =0
virtual void exit_state(const event &_event, event_collector &_event_collector)=0
virtual bool has_error_event() const =0
sxe::shared_ptr< event > event_sptr
Definition: event_fwd.hpp:25
virtual ~state() SX_NOEXCEPT SX_OVERRIDE
Definition: state.hpp:43
Definition: state_visitor.hpp:25
virtual void accept_state_visitor(state_visitor &_visitor) const =0
virtual bool is_event_deferred(const event_id &_event_id) const =0
virtual behavior * get_exit_behavior() const =0
virtual void enter_state(const event &_event, event_collector &_event_collector)=0