Motion Master
Loading...
Searching...
No Matches
MonitorMachine Class Reference

#include <monitor_machine.h>

Inheritance diagram for MonitorMachine:
Collaboration diagram for MonitorMachine:

Public Member Functions

 MonitorMachine (VirtualDeviceManager &vdm, ctpl::thread_pool &thread_pool, Notifier &notifier, mm::core::containers::ThreadSafeQueue< OutgoingMachineMessage > &outgoing_machine_message_queue)
 ~MonitorMachine () override
void execute (uint64_t pending_signals) override
 Execute the machine.
void abort_all_client_requests ()
void abort_client_requests (const std::string &connection_id) override
 Abort all of the requests a certain client has issues.
void abort_client_requests_by_topic (const std::string &topic)
void abort_client_requests_by_device_address (uint32_t device_address)
bool done () override
 Check if all of the machine started processes are done (including the Command Workers)
mm::comm::spoe::Device * get_ethernet_device (uint32_t device_address)
Public Member Functions inherited from Machine
void add_message (IncomingMachineMessage &incoming_machine_message)
 Add a new incoming machine message to the queue.
bool command_workers_done ()
 Check if all started Command Workers are done.

Friends

class CommandWorker

Additional Inherited Members

Protected Member Functions inherited from Machine
 Machine (VirtualDeviceManager &vdm, ctpl::thread_pool &thread_pool, Notifier &notifier, mm::core::containers::ThreadSafeQueue< OutgoingMachineMessage > &outgoing_machine_message_queue)
virtual ~Machine ()
void start_command_worker (IncomingMachineMessage &incoming_machine_message)
void process_command_workers (std::function< void(CommandWorker *)> process=nullptr)
 Process all of the available Command Workers.
void send_response (MachineMessage::Protocol protocol, std::string connection_id, motionmaster::MotionMasterMessage &message)
 Send the response (Status protobuf message) to the proper client.
Protected Attributes inherited from Machine
VirtualDeviceManager & vdm_
ctpl::thread_pool & thread_pool_
std::queue< IncomingMachineMessage > incoming_message_queue_
Notifier & notifier_

Constructor & Destructor Documentation

◆ MonitorMachine()

MonitorMachine::MonitorMachine ( VirtualDeviceManager & vdm,
ctpl::thread_pool & thread_pool,
Notifier & notifier,
mm::core::containers::ThreadSafeQueue< OutgoingMachineMessage > & outgoing_machine_message_queue )

◆ ~MonitorMachine()

MonitorMachine::~MonitorMachine ( )
override

Member Function Documentation

◆ abort_all_client_requests()

void MonitorMachine::abort_all_client_requests ( )

◆ abort_client_requests()

void MonitorMachine::abort_client_requests ( const std::string & connection_id)
overridevirtual

Abort all of the requests a certain client has issues.

Parameters
connection_idclient connection ID

Implements Machine.

◆ abort_client_requests_by_device_address()

void MonitorMachine::abort_client_requests_by_device_address ( uint32_t device_address)

◆ abort_client_requests_by_topic()

void MonitorMachine::abort_client_requests_by_topic ( const std::string & topic)

◆ done()

bool MonitorMachine::done ( )
overridevirtual

Check if all of the machine started processes are done (including the Command Workers)

Returns
true if all of the processes are done, false otherwise

Implements Machine.

◆ execute()

void MonitorMachine::execute ( uint64_t pending_signals)
overridevirtual

Execute the machine.

Parameters
pending_signalsnumber of time intervals that passed since the last call to this function

Implements Machine.

◆ get_ethernet_device()

mm::comm::spoe::Device * MonitorMachine::get_ethernet_device ( uint32_t device_address)
inline

◆ CommandWorker

friend class CommandWorker
friend

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