Motion Master
Loading...
Searching...
No Matches
notifier.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <mutex>
5#include <queue>
6#include <zmq.hpp>
7
9
10class Notifier {
11 public:
23 void send_slave_warning(uint32_t device_address, int32_t device_id,
24 int32_t code,
25 const std::string& additional_info = "");
26
38 void send_slave_error(uint32_t device_address, int32_t device_id,
39 int32_t code, const std::string& additional_info = "");
40
47 void send_status(motionmaster::MotionMasterMessage::Status* status,
48 std::string topic = "");
49
56 motionmaster::MotionMasterMessage::Status* status);
57
64 motionmaster::MotionMasterMessage::Status* status);
65
71
77
82
87
93
99
108
114 bool has_notification();
115
129
130 private:
131 std::mutex lock_;
132 std::queue<OutgoingMachineMessage> notifications_;
133};
Definition: notifier.h:10
void send_mm_state_waiting_for_slaves()
Send a notification over ZeroMQ that Motion Master is waiting for slaves.
Definition: notifier.cc:115
void send_mm_state_initialized()
Send a notification over ZeroMQ that Motion Master has initialized.
Definition: notifier.cc:170
void send_mm_state_deinitializing()
Send a notification over ZeroMQ that Motion Master is deinitializing.
Definition: notifier.cc:188
void send_mm_state_slaves_found()
Send a notification over ZeroMQ that Motion Master has found slaves.
Definition: notifier.cc:134
void send_notification_status(motionmaster::MotionMasterMessage::Status *status)
Send a notification status message.
Definition: notifier.cc:101
void send_slave_warning(uint32_t device_address, int32_t device_id, int32_t code, const std::string &additional_info="")
Send a slave warning message over ZeroMQ.
Definition: notifier.cc:8
void send_monitoring_status(motionmaster::MotionMasterMessage::Status *status)
Send a monitoring status message.
Definition: notifier.cc:87
void send_mm_state_terminating()
Send a notification over ZeroMQ that Motion Master is being terminated.
Definition: notifier.cc:225
void send_slave_error(uint32_t device_address, int32_t device_id, int32_t code, const std::string &additional_info="")
Send a slave error message over ZeroMQ.
Definition: notifier.cc:41
bool get_next_notification(OutgoingMachineMessage &message)
Get the next notification from the notification queue.
Definition: notifier.cc:245
bool has_notification()
Check if there are any pending notifications.
Definition: notifier.cc:243
void send_status(motionmaster::MotionMasterMessage::Status *status, std::string topic="")
Send a status message.
Definition: notifier.cc:74
void send_mm_state_initializing()
Send a notification over ZeroMQ that Motion Master is initializing.
Definition: notifier.cc:152
void send_mm_state_deinitialized()
Send a notification over ZeroMQ that Motion Master has deinitialized.
Definition: notifier.cc:207
Definition: outgoing_machine_message.h:5