This module implements Client/Server RPC and publish/subscribe mechanism using ZMQ.
◆ overloaded()
◆ parseMessage()
| void mvsim::parseMessage |
( |
const zmq::message_t & |
msg, |
|
|
google::protobuf::MessageLite & |
out |
|
) |
| |
Parses a ZMQ message received as sent by sendMessage(), and decodes it into the provided google::protobuf message. Use this signature when the expected type of the received message is known before hand.
- Exceptions
-
| std::runtime_error | If the message type does not match with out. |
◆ parseMessageVariant()
template<typename variant_t >
| variant_t mvsim::parseMessageVariant |
( |
const zmq::message_t & |
msg | ) |
|
Parses a ZMQ message into one of a set of possible protobuf message types, passed as a std::variant<...>.
- Exceptions
-
◆ receiveMessage()
| zmq::message_t mvsim::receiveMessage |
( |
zmq::socket_t & |
s | ) |
|
Receives a message from the socket.
◆ sendMessage()
| void mvsim::sendMessage |
( |
const google::protobuf::MessageLite & |
m, |
|
|
zmq::socket_t & |
socket |
|
) |
| |
Sends a ZMQ message comprising:
- std::string with the protobuf message type name.
- std::string with the binary serialization of the message itself.