12 #ifndef ASYNC_STATE_MACHINE_5D531F9B_A0F2_47FF_BCFC_3264896355C5 13 #define ASYNC_STATE_MACHINE_5D531F9B_A0F2_47FF_BCFC_3264896355C5 18 #include "essentials/compatibility/thread.hpp" 19 #include "essentials/compatibility/chrono.hpp" 34 public state_machine_base,
private async_event_handler
42 event_processing_callback*
const _event_processing_callback = SX_NULLPTR );
51 virtual
bool fire_event( const
event_sptr& _event ) SX_OVERRIDE;
58 virtual
bool run() SX_OVERRIDE;
72 virtual
void halt() SX_OVERRIDE;
84 bool wait( const sxe::milliseconds _timeoutInMs ) const;
94 bool terminated() const;
102 virtual
bool push( const
event_sptr& _event ) SX_OVERRIDE;
106 void start_state_machine();
112 bool wait_predicate() const;
113 bool wait_stop_condition() const;
118 virtual
void on_event( const
event_sptr& _event ) SX_OVERRIDE;
119 virtual
void interrupt_impl() SX_OVERRIDE;
123 mutable sxe::mutex run_and_event_mutex_;
124 sxe::condition_variable run_and_event_condition_;
125 mutable sxe::condition_variable terminated_condition_;
126 sxe::SX_UNIQUE_PTR< sxe::thread > worker_thread_;
Definition: adapter_cpp11.hpp:21
state_machine_status
Definition: state_machine_status.hpp:21
Class for the "multi-threaded version" of the state machine. Provides methods to start and halt the s...
sxe::shared_ptr< event > event_sptr
Definition: event_fwd.hpp:25