8#include <daq/hbasf2/connections/ZMQROIConnection.h>
14 bool addEventSize,
const std::shared_ptr<ZMQParent>& 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);
23 m_dataOutput.handleEvent(std::move(message->getDataMessage()));
24 m_roiOutput.handleEvent(std::move(message->getAdditionalDataMessage()));
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.
Abstract base class for different kinds of events.