8#include <daq/hbasf2/connections/ZMQROIConnection.h>
14 bool addEventSize,
const std::shared_ptr<ZMQParent>& parent) :
15 m_dataOutput(dataAddress, addEventSize, parent), m_roiOutput(roiAddress, false, parent) {}
19 if (message->isMessage(EMessageTypes::c_rawDataMessage) or message->isMessage(EMessageTypes::c_eventMessage)) {
20 B2ASSERT(
"The data message needs to be present!", message->getDataMessage().size() > 0);
21 B2ASSERT(
"The roi message needs to be present!", message->getAdditionalDataMessage().size() > 0);
std::vector< zmq::socket_t * > getSockets() const final
The socket used for polling is just the stored socket.
static bool hasMessage(const ZMQConnection *connection)
Check if the given connection as an incoming message (right now, no waiting).
void handleIncomingData()
Handle both a socket (dis)connect by raw or ROI.
ZMQRawOutput m_dataOutput
The used raw connection.
std::string getROIMonitoringJSON() const
Get the monitoring JSON from the ROI connection.
bool isReady() const final
Ready only when both sockets are ready.
std::string getMonitoringJSON() const final
Get the monitoring JSON from the raw connection.
ZMQRawOutput m_roiOutput
The used ROI connection.
void handleEvent(std::unique_ptr< ZMQNoIdMessage > message)
Send the normal data message to raw and the additional message to ROI.
std::vector< zmq::socket_t * > getSockets() const final
Return both sockets for polling.
ZMQDataAndROIOutput(const std::string &dataAddress, const std::string &roiAddress, bool addEventSize, const std::shared_ptr< ZMQParent > &parent)
Initialize the raw and roi connection.
virtual std::string getMonitoringJSON() const
Convert the stored monitoring values to a JSON string ready for sending out via a message.
void handleIncomingData()
Handle incoming data: a socket (dis)connect.
virtual void handleEvent(zmq::message_t message)
Pass on the message - maybe by prefixing it with a htonl-converted data size in bytes.
bool isReady() const final
If no socket is connected, this connection is not ready.
Abstract base class for different kinds of events.