Struct StateMachine¶
Defined in File StateMachine.hpp
Inheritance Relationships¶
Base Type¶
public boost::statechart::asynchronous_state_machine< StateMachine, Standby, bsc::fifo_scheduler<>, std::allocator< void >, bsc::exception_translator<> >
Struct Documentation¶
-
struct mimir::StateMachine : public boost::statechart::asynchronous_state_machine<StateMachine, Standby, bsc::fifo_scheduler<>, std::allocator<void>, bsc::exception_translator<>>¶
State machine for the algorithm.
The core program logic is implemented an asynchronous state machine. The state diagram below describes it. Its main purpose is to call the functions of an IAlgorithm implementation according to a set pattern.
Public Functions
-
StateMachine(my_context ctx, const YAML::Node &config, std::atomic<bool> ¬ify_others)¶
Constructor for state machine.
The constructor creates instances of DDS-related stuff, such as
DdsTriad : Initialized domain participant with publisher and subscriber instances.
CommandResponder : Class for interacting with other programs via DDS.
StateNotifier : Class that notifies subscribers of which state the state machine is in.
- Parameters
ctx – [in] Context construct needed for the asynchronous state machine
config – [in] YAML config, user provided configuration file
notify_others – [in] Reference to external boolean for inter-thread notification of living state machine.
-
~StateMachine()¶
Destructor.
-
DdsTriad *Dds()¶
Pointer to the DdsTriad.
-
inline control::StateNotifier *Notifier()¶
Pointer to the StateNotifier.
-
inline const YAML::Node &Config()¶
Reference to YAML configuration.
Private Members
-
std::unique_ptr<DdsTriad> m_dds¶
Instance of participant, publisher and subscriber.
-
std::unique_ptr<control::CommandResponder> m_responder¶
-
std::unique_ptr<control::StateNotifier> m_notifier¶
-
std::atomic<bool> &m_notify_others¶
External boolean to notify others of terminated state machine.
-
const YAML::Node m_config¶
YAML configuration for state machine and algorithm.
-
StateMachine(my_context ctx, const YAML::Node &config, std::atomic<bool> ¬ify_others)¶