8#include <framework/pcore/zmq/connections/ZMQSimpleConnection.h>
9#include <framework/pcore/zmq/messages/ZMQMessageFactory.h>
18 log(
"monitoring_counter", 0l);
23 auto message = ZMQMessageFactory::fromSocket<ZMQIdMessage>(
m_socket);
Specialized connection over a ZMQ socket.
std::shared_ptr< ZMQParent > m_parent
The shared ZMQParent instance.
std::unique_ptr< zmq::socket_t > m_socket
The memory of the socket. Needs to be initialized in a derived class.
void increment(const std::string &key)
Increment the value with the given key (only numerical values). If not present, set to 1.
std::unique_ptr< ZMQIdMessage > handleIncomingData()
Block until there is an incoming message and return it as a ZMQIdMessage.
void handleEvent(std::unique_ptr< ZMQIdMessage > message)
Send the given message via the socket (the message includes the identity to send to)
ZMQSimpleConnection(const std::string &monitoringAddress, const std::shared_ptr< ZMQParent > &parent)
Create a new simple connection with a ZMQ_ROUTER socket binding to the given address.
static void send(std::unique_ptr< zmq::socket_t > &socket, AZMQMessage message)
Send a given message over the given created socket. You need to move in the message for zero-copy.
void log(const std::string &key, const AClass &value)
Store a value under a certain key. Different types of values can be stored, namely long,...
Abstract base class for different kinds of events.