Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
packml_sm::PackmlStateMachine< T > Class Template Reference

#include <packml_state_machine.h>

Inheritance diagram for packml_sm::PackmlStateMachine< T >:
Inheritance graph
[legend]

Public Member Functions

virtual bool activate () override
 Override to handle activate command. More...
 
virtual bool deactivate () override
 Override to handle deactivate command. More...
 
virtual bool isActive () override
 Override to provide an accessor to whether the state machine is currently active. More...
 
virtual bool setAborting (std::function< int()> state_method) override
 Override to handle setting the aborting state method. More...
 
virtual bool setClearing (std::function< int()> state_method) override
 Override to handle setting the clearing state method. More...
 
virtual bool setCompleting (std::function< int()> state_method) override
 Override to handle setting the completing state method. More...
 
virtual bool setExecute (std::function< int()> state_method) override
 Override to handle setting the execute state method. More...
 
virtual bool setHolding (std::function< int()> state_method) override
 Override to handle setting the holding state method. More...
 
virtual bool setResetting (std::function< int()> state_method) override
 Override to handle setting the resetting state method. More...
 
virtual bool setStarting (std::function< int()> state_method) override
 Override to handle setting the starting state method. More...
 
virtual bool setStopping (std::function< int()> state_method) override
 Override to handle setting the stopping state method. More...
 
virtual bool setSuspending (std::function< int()> state_method) override
 Override to handle setting the suspending state method. More...
 
virtual bool setUnholding (std::function< int()> state_method) override
 Override to handle setting unholding state method. More...
 
virtual bool setUnsuspending (std::function< int()> state_method) override
 Override to handle setting the un-suspending state method. More...
 
virtual ~PackmlStateMachine ()
 
- Public Member Functions inherited from packml_sm::AbstractStateMachine
virtual bool abort ()
 Call to send the abort command. More...
 
 AbstractStateMachine ()
 Constructor for AbstractStateMachine. More...
 
virtual bool clear ()
 Call to send the clear command. More...
 
double getAbortedTime ()
 Accessor for the duration spent in aborted. More...
 
double getAbortingTime ()
 Accessor for the duration spent in aborting. More...
 
double getClearingTime ()
 Accessor for the duration spent in clearing. More...
 
double getCompleteTime ()
 Accessor for the duration spent in complete. More...
 
StatesEnum getCurrentState () const
 Accessor for the current state. More...
 
void getCurrentStatSnapshot (PackmlStatsSnapshot &snapshot_out)
 Fills the reference variable with the current stats snapshot. More...
 
double getExecuteTime ()
 Accessor for the duration spent in execute. More...
 
double getHeldTime ()
 Accessor for the duration spent in held. More...
 
double getHoldingTime ()
 Accessor for the duration spent in holding. More...
 
double getIdleTime ()
 Accessor for the duration spent in idle time. More...
 
double getResettingTime ()
 Accessor for the duration spent in resetting. More...
 
double getStartingTime ()
 Accessor for the duration spent in starting. More...
 
double getStoppedTime ()
 Accessor for the duration spent in stopped. More...
 
double getStoppingTime ()
 Accessor for the duration spent in stopping. More...
 
double getSuspendedTime ()
 Accessor for the duration spent in suspended. More...
 
double getSuspendingTime ()
 Accessor for the duration spent in suspending. More...
 
double getUnholdingTime ()
 Accessor for the duration spent in unholding. More...
 
double getUnsuspendingTime ()
 Accessor for the duration spent in unsuspending. More...
 
virtual bool hold ()
 Call to send the hold command. More...
 
void incrementErrorStatItem (int16_t id, int32_t count, double duration)
 Call to increment or add a specific Itemized error stat. More...
 
void incrementFailureCount ()
 Call to increment the failed operation count. More...
 
void incrementQualityStatItem (int16_t id, int32_t count, double duration)
 Call to increment or add a specific Itemized quality stat. More...
 
void incrementSuccessCount ()
 Call to increment the successful operation count. More...
 
virtual bool reset ()
 Call to send the reset command. More...
 
void resetStats ()
 Reset all of the tracked states. More...
 
void setIdealCycleTime (float ideal_cycle_time)
 Sets the ideal cycle time in operations per second. More...
 
virtual bool start ()
 Call to send the start command. More...
 
virtual bool stop ()
 Call to send the stop command. More...
 
virtual bool suspend ()
 Call to send the suspend command. More...
 
virtual bool unhold ()
 Call to send the unhold command. More...
 
virtual bool unsuspend ()
 Call to send the unsuspend command. More...
 
virtual ~AbstractStateMachine ()
 Destructor for AbstractStateMachine. More...
 

Protected Member Functions

virtual void _abort () override
 Override to call implementations version of the abort command. More...
 
virtual void _clear () override
 Override to call implementations version of clear command. More...
 
virtual void _hold () override
 Override to call implementations version of the hold command. More...
 
virtual void _reset () override
 Override to call implementations version of the reset command. More...
 
virtual void _start () override
 Override to call implementations version of start command. More...
 
virtual void _stop () override
 Override to call implementations version of the stop command. More...
 
virtual void _suspend () override
 Override to call implementations version of the suspend command. More...
 
virtual void _unhold () override
 Override to call implementations version of the unhold command. More...
 
virtual void _unsuspend () override
 Override to call implementations version of the unsuspend command. More...
 
 PackmlStateMachine ()
 
- Protected Member Functions inherited from packml_sm::AbstractStateMachine
void invokeStateChangedEvent (const std::string &name, StatesEnum value)
 Call to invoke a state changed event. More...
 

Private Member Functions

PackmlStategetPackmlState (StatesEnum state)
 
void handleStateChanged (StateChangeNotifier &state_machine, const StateChangedEventArgs &args)
 
void sendCommand (CmdEnum command)
 
bool setStateMethod (StatesEnum state, std::function< int()> state_method)
 
void update (StateMachineEventLoop &event_loop, const EventArgs &args)
 

Private Attributes

boost::msm::back::state_machine< T > boost_fsm_
 
StateMachineEventLoop event_loop_
 
bool is_active_ = false
 

Additional Inherited Members

- Public Attributes inherited from packml_sm::AbstractStateMachine
EventHandler< AbstractStateMachine, StateChangedEventArgsstateChangedEvent
 

Detailed Description

template<typename T>
class packml_sm::PackmlStateMachine< T >

Definition at line 36 of file packml_state_machine.h.

Constructor & Destructor Documentation

template<typename T >
packml_sm::PackmlStateMachine< T >::~PackmlStateMachine ( )
virtual

Definition at line 36 of file packml_state_machine.cpp.

template<typename T >
packml_sm::PackmlStateMachine< T >::PackmlStateMachine ( )
protected

Definition at line 24 of file packml_state_machine.cpp.

Member Function Documentation

template<typename T >
void packml_sm::PackmlStateMachine< T >::_abort ( )
overrideprotectedvirtual

Override to call implementations version of the abort command.

Implements packml_sm::AbstractStateMachine.

Definition at line 186 of file packml_state_machine.cpp.

template<typename T >
void packml_sm::PackmlStateMachine< T >::_clear ( )
overrideprotectedvirtual

Override to call implementations version of clear command.

Implements packml_sm::AbstractStateMachine.

Definition at line 144 of file packml_state_machine.cpp.

template<typename T >
void packml_sm::PackmlStateMachine< T >::_hold ( )
overrideprotectedvirtual

Override to call implementations version of the hold command.

Implements packml_sm::AbstractStateMachine.

Definition at line 156 of file packml_state_machine.cpp.

template<typename T >
void packml_sm::PackmlStateMachine< T >::_reset ( )
overrideprotectedvirtual

Override to call implementations version of the reset command.

Implements packml_sm::AbstractStateMachine.

Definition at line 150 of file packml_state_machine.cpp.

template<typename T >
void packml_sm::PackmlStateMachine< T >::_start ( )
overrideprotectedvirtual

Override to call implementations version of start command.

Implements packml_sm::AbstractStateMachine.

Definition at line 138 of file packml_state_machine.cpp.

template<typename T >
void packml_sm::PackmlStateMachine< T >::_stop ( )
overrideprotectedvirtual

Override to call implementations version of the stop command.

Implements packml_sm::AbstractStateMachine.

Definition at line 180 of file packml_state_machine.cpp.

template<typename T >
void packml_sm::PackmlStateMachine< T >::_suspend ( )
overrideprotectedvirtual

Override to call implementations version of the suspend command.

Implements packml_sm::AbstractStateMachine.

Definition at line 168 of file packml_state_machine.cpp.

template<typename T >
void packml_sm::PackmlStateMachine< T >::_unhold ( )
overrideprotectedvirtual

Override to call implementations version of the unhold command.

Implements packml_sm::AbstractStateMachine.

Definition at line 162 of file packml_state_machine.cpp.

template<typename T >
void packml_sm::PackmlStateMachine< T >::_unsuspend ( )
overrideprotectedvirtual

Override to call implementations version of the unsuspend command.

Implements packml_sm::AbstractStateMachine.

Definition at line 174 of file packml_state_machine.cpp.

template<typename T >
bool packml_sm::PackmlStateMachine< T >::activate ( )
overridevirtual

Override to handle activate command.

Returns
bool Returns true on success.

Implements packml_sm::AbstractStateMachine.

Definition at line 48 of file packml_state_machine.cpp.

template<typename T >
bool packml_sm::PackmlStateMachine< T >::deactivate ( )
overridevirtual

Override to handle deactivate command.

Returns
bool Returns true on success.

Implements packml_sm::AbstractStateMachine.

Definition at line 57 of file packml_state_machine.cpp.

template<typename T >
PackmlState * packml_sm::PackmlStateMachine< T >::getPackmlState ( StatesEnum  state)
private

Definition at line 229 of file packml_state_machine.cpp.

template<typename T >
void packml_sm::PackmlStateMachine< T >::handleStateChanged ( StateChangeNotifier state_machine,
const StateChangedEventArgs args 
)
private

Definition at line 308 of file packml_state_machine.cpp.

template<typename T >
bool packml_sm::PackmlStateMachine< T >::isActive ( )
overridevirtual

Override to provide an accessor to whether the state machine is currently active.

Returns
bool Returns true if active.

Implements packml_sm::AbstractStateMachine.

Definition at line 132 of file packml_state_machine.cpp.

template<typename T >
void packml_sm::PackmlStateMachine< T >::sendCommand ( CmdEnum  command)
private

Definition at line 192 of file packml_state_machine.cpp.

template<typename T >
bool packml_sm::PackmlStateMachine< T >::setAborting ( std::function< int()>  state_method)
overridevirtual

Override to handle setting the aborting state method.

Parameters
state_methodThe state method to execute when entering the aborting state.
Returns
bool Returns true on success.

Implements packml_sm::AbstractStateMachine.

Definition at line 84 of file packml_state_machine.cpp.

template<typename T >
bool packml_sm::PackmlStateMachine< T >::setClearing ( std::function< int()>  state_method)
overridevirtual

Override to handle setting the clearing state method.

Parameters
state_methodThe state method to execute when entering the clearing state.
Returns
bool Returns true on success.

Implements packml_sm::AbstractStateMachine.

Definition at line 90 of file packml_state_machine.cpp.

template<typename T >
bool packml_sm::PackmlStateMachine< T >::setCompleting ( std::function< int()>  state_method)
overridevirtual

Override to handle setting the completing state method.

Parameters
state_methodThe state method to execute when entering the completing state.
Returns
bool Returns true on success.

Implements packml_sm::AbstractStateMachine.

Definition at line 78 of file packml_state_machine.cpp.

template<typename T >
bool packml_sm::PackmlStateMachine< T >::setExecute ( std::function< int()>  state_method)
overridevirtual

Override to handle setting the execute state method.

Parameters
state_methodThe state method to execute when entering the exec state.
Returns
bool Returns true on success.

Implements packml_sm::AbstractStateMachine.

Definition at line 72 of file packml_state_machine.cpp.

template<typename T >
bool packml_sm::PackmlStateMachine< T >::setHolding ( std::function< int()>  state_method)
overridevirtual

Override to handle setting the holding state method.

Parameters
state_methodThe state method to execute when entering the holding state.
Returns
bool Returns true on success.

Implements packml_sm::AbstractStateMachine.

Definition at line 120 of file packml_state_machine.cpp.

template<typename T >
bool packml_sm::PackmlStateMachine< T >::setResetting ( std::function< int()>  state_method)
overridevirtual

Override to handle setting the resetting state method.

Parameters
state_methodThe state method to execute when entering the resetting state.
Returns
bool Returns true on success.

Implements packml_sm::AbstractStateMachine.

Definition at line 102 of file packml_state_machine.cpp.

template<typename T >
bool packml_sm::PackmlStateMachine< T >::setStarting ( std::function< int()>  state_method)
overridevirtual

Override to handle setting the starting state method.

Parameters
state_methodThe state method to execute when entering the start state.
Returns
bool Returns true on success.

Implements packml_sm::AbstractStateMachine.

Definition at line 66 of file packml_state_machine.cpp.

template<typename T >
bool packml_sm::PackmlStateMachine< T >::setStateMethod ( StatesEnum  state,
std::function< int()>  state_method 
)
private

Definition at line 294 of file packml_state_machine.cpp.

template<typename T >
bool packml_sm::PackmlStateMachine< T >::setStopping ( std::function< int()>  state_method)
overridevirtual

Override to handle setting the stopping state method.

Parameters
state_methodThe state method to execute when entering the stopping state.
Returns
bool Returns true on success.

Implements packml_sm::AbstractStateMachine.

Definition at line 96 of file packml_state_machine.cpp.

template<typename T >
bool packml_sm::PackmlStateMachine< T >::setSuspending ( std::function< int()>  state_method)
overridevirtual

Override to handle setting the suspending state method.

Parameters
state_methodThe state method to execute when entering the suspending state.
Returns
bool Returns true on success.

Implements packml_sm::AbstractStateMachine.

Definition at line 108 of file packml_state_machine.cpp.

template<typename T >
bool packml_sm::PackmlStateMachine< T >::setUnholding ( std::function< int()>  state_method)
overridevirtual

Override to handle setting unholding state method.

Parameters
state_methodThe state method to execute when entering the unholding state.
Returns
bool Returns true on success.

Implements packml_sm::AbstractStateMachine.

Definition at line 126 of file packml_state_machine.cpp.

template<typename T >
bool packml_sm::PackmlStateMachine< T >::setUnsuspending ( std::function< int()>  state_method)
overridevirtual

Override to handle setting the un-suspending state method.

Parameters
state_methodThe state method to execute when entering the unsuspending state.
Returns
bool Returns true on success.

Implements packml_sm::AbstractStateMachine.

Definition at line 114 of file packml_state_machine.cpp.

template<typename T >
void packml_sm::PackmlStateMachine< T >::update ( StateMachineEventLoop event_loop,
const EventArgs args 
)
private

Definition at line 314 of file packml_state_machine.cpp.

Member Data Documentation

template<typename T>
boost::msm::back::state_machine<T> packml_sm::PackmlStateMachine< T >::boost_fsm_
private

Definition at line 73 of file packml_state_machine.h.

template<typename T>
StateMachineEventLoop packml_sm::PackmlStateMachine< T >::event_loop_
private

Definition at line 74 of file packml_state_machine.h.

template<typename T>
bool packml_sm::PackmlStateMachine< T >::is_active_ = false
private

Definition at line 71 of file packml_state_machine.h.


The documentation for this class was generated from the following files:


packml_sm
Author(s): Shaun Edwards
autogenerated on Fri Jul 12 2019 03:30:55