27 if (state_change_notifier !=
nullptr)
39 if (state_change_notifier !=
nullptr)
101 template <
typename T>
107 template <
typename T>
113 template <
typename T>
119 template <
typename T>
125 template <
typename T>
131 template <
typename T>
137 template <
typename T>
143 template <
typename T>
149 template <
typename T>
155 template <
typename T>
161 template <
typename T>
167 template <
typename T>
173 template <
typename T>
179 template <
typename T>
185 template <
typename T>
191 template <
typename T>
228 template <
typename T>
236 state_machine_state =
static_cast<PackmlState*
>(boost_fsm_.template get_state<Stopped_impl*>());
239 state_machine_state =
static_cast<PackmlState*
>(boost_fsm_.template get_state<Starting_impl*>());
242 state_machine_state =
static_cast<PackmlState*
>(boost_fsm_.template get_state<Idle_impl*>());
245 state_machine_state =
static_cast<PackmlState*
>(boost_fsm_.template get_state<Suspended_impl*>());
248 state_machine_state =
static_cast<PackmlState*
>(boost_fsm_.template get_state<Execute_impl*>());
251 state_machine_state =
static_cast<PackmlState*
>(boost_fsm_.template get_state<Stopping_impl*>());
254 state_machine_state =
static_cast<PackmlState*
>(boost_fsm_.template get_state<Aborting_impl*>());
257 state_machine_state =
static_cast<PackmlState*
>(boost_fsm_.template get_state<Aborted_impl*>());
260 state_machine_state =
static_cast<PackmlState*
>(boost_fsm_.template get_state<Holding_impl*>());
263 state_machine_state =
static_cast<PackmlState*
>(boost_fsm_.template get_state<Held_impl*>());
266 state_machine_state =
static_cast<PackmlState*
>(boost_fsm_.template get_state<Resetting_impl*>());
269 state_machine_state =
static_cast<PackmlState*
>(boost_fsm_.template get_state<Suspending_impl*>());
272 state_machine_state =
static_cast<PackmlState*
>(boost_fsm_.template get_state<UnSuspending_impl*>());
275 state_machine_state =
static_cast<PackmlState*
>(boost_fsm_.template get_state<Clearing_impl*>());
278 state_machine_state =
static_cast<PackmlState*
>(boost_fsm_.template get_state<UnHolding_impl*>());
281 state_machine_state =
static_cast<PackmlState*
>(boost_fsm_.template get_state<Completing_impl*>());
284 state_machine_state =
static_cast<PackmlState*
>(boost_fsm_.template get_state<Complete_impl*>());
290 return state_machine_state;
293 template <
typename T>
296 PackmlState* state_machine_state = getPackmlState(state);
298 if (state_machine_state !=
nullptr)
307 template <
typename T>
310 invokeStateChangedEvent(args.
name, args.
value);
313 template <
typename T>
316 if (boost_fsm_.get_message_queue_size() > 0)
318 boost_fsm_.execute_queued_events();
virtual bool setStarting(std::function< int()> state_method) override
Override to handle setting the starting state method.
virtual void _start() override
Override to call implementations version of start command.
void update(StateMachineEventLoop &event_loop, const EventArgs &args)
virtual bool setHolding(std::function< int()> state_method) override
Override to handle setting the holding state method.
PackmlState * getPackmlState(StatesEnum state)
virtual bool setCompleting(std::function< int()> state_method) override
Override to handle setting the completing state method.
virtual bool isActive() override
Override to provide an accessor to whether the state machine is currently active. ...
virtual void _reset() override
Override to call implementations version of the reset command.
virtual bool setClearing(std::function< int()> state_method) override
Override to handle setting the clearing state method.
virtual bool setStopping(std::function< int()> state_method) override
Override to handle setting the stopping state method.
virtual void _unsuspend() override
Override to call implementations version of the unsuspend command.
virtual bool activate() override
Override to handle activate command.
virtual bool setSuspending(std::function< int()> state_method) override
Override to handle setting the suspending state method.
virtual void _hold() override
Override to call implementations version of the hold command.
virtual ~PackmlStateMachine()
virtual bool setUnsuspending(std::function< int()> state_method) override
Override to handle setting the un-suspending state method.
virtual bool setResetting(std::function< int()> state_method) override
Override to handle setting the resetting state method.
void setStateMethod(std::function< int()> state_method)
virtual void _abort() override
Override to call implementations version of the abort command.
virtual void _stop() override
Override to call implementations version of the stop command.
virtual bool setAborting(std::function< int()> state_method) override
Override to handle setting the aborting state method.
void handleStateChanged(StateChangeNotifier &state_machine, const StateChangedEventArgs &args)
bool setStateMethod(StatesEnum state, std::function< int()> state_method)
virtual bool deactivate() override
Override to handle deactivate command.
virtual void _unhold() override
Override to call implementations version of the unhold command.
virtual void _clear() override
Override to call implementations version of clear command.
virtual void _suspend() override
Override to call implementations version of the suspend command.
void sendCommand(CmdEnum command)
static void LogError(const char *format,...)
virtual bool setExecute(std::function< int()> state_method) override
Override to handle setting the execute state method.
EventHandler< StateChangeNotifier, StateChangedEventArgs > stateChangedEvent
virtual bool setUnholding(std::function< int()> state_method) override
Override to handle setting unholding state method.