10#include <framework/pcore/zmq/connections/ZMQConnection.h>
11#include <daq/hbasf2/utils/HistogramMapping.h>
13#include <framework/pcore/zmq/connections/ZMQNullConnection.h>
14#include <framework/pcore/zmq/connections/ZMQConfirmedConnection.h>
15#include <framework/pcore/zmq/connections/ZMQRawConnection.h>
17#include <framework/pcore/zmq/messages/ZMQIdMessage.h>
19#include <framework/pcore/EvtMessage.h>
50 const std::string& rootFileName);
53 void mergeAndSend(
const std::map<std::string, HistogramMapping>& storedMessages,
const std::optional<unsigned int>& experiment,
54 const std::optional<unsigned int>& run,
60 std::vector<zmq::socket_t*>
getSockets()
const final;
86 void mergeAndSend(
const std::map<std::string, HistogramMapping>& storedMessages,
const std::optional<unsigned int>& experiment,
87 const std::optional<unsigned int>& run,
125 void mergeAndSend(
const std::map<std::string, HistogramMapping>& storedMessages,
const std::optional<unsigned int>& experiment,
126 const std::optional<unsigned int>& run,
Output part of a confirmed connection.
Base class for every connection with virtual functions to be implemented:
std::string m_rootFileName
Output file name (possible with placeholders)
std::string getEndPoint() const
Return the connection string.
void handleIncomingData()
There should be never incoming data, so raise an exception if called anyways.
std::string m_dqmMemFileName
Name of the shared memory.
void mergeAndSend(const std::map< std::string, HistogramMapping > &storedMessages, const std::optional< unsigned int > &experiment, const std::optional< unsigned int > &run, EMessageTypes messageType)
Merge the given histograms into a single set of histograms and store them to file/shm.
void clear()
Clear the shared memory.
std::vector< zmq::socket_t * > getSockets() const final
No sockets to poll on, so return an empty list.
ZMQHistoServerToFileOutput(const std::string &dqmFileName, const std::string &rootFileName)
Create a new connection initializing the DQMMemFile.
std::string getEndPoint() const
Return the connection string.
ZMQHistoServerToRawOutput(const std::string &outputAddress, const std::shared_ptr< ZMQParent > &parent)
Create a new raw output with the given address.
void handleIncomingData()
The input data handling is passed from the ZMQRawOutput.
ZMQRawOutput m_output
The output connection used for sending the histograms.
void mergeAndSend(const std::map< std::string, HistogramMapping > &storedMessages, const std::optional< unsigned int > &experiment, const std::optional< unsigned int > &run, EMessageTypes messageType)
Merge the histograms and send them via the connection. Stop/Terminate messages are not sent.
bool isReady() const override
The is ready is passed from the ZMQRawOutput.
std::string getMonitoringJSON() const final
The monitoring JSON is just passed from the ZMQRawOutput.
void clear()
Nothing to do on clear.
std::vector< zmq::socket_t * > getSockets() const final
The sockets are passed from ZMQRawOutput.
ZMQConfirmedOutput m_output
The output connection used for sending the histograms.
std::string getEndPoint() const
Return the connection string.
std::vector< char > m_outputBuffer
Buffer used for compression.
void handleIncomingData()
The input data handling is passed from the ZMQConfirmedOutput.
ZMQHistoServerToZMQOutput(const std::string &outputAddress, const std::shared_ptr< ZMQParent > &parent)
Initialize the ZMQConfirmedOutput with the given address.
void mergeAndSend(const std::map< std::string, HistogramMapping > &storedMessages, const std::optional< unsigned int > &experiment, const std::optional< unsigned int > &run, EMessageTypes messageType)
Merge the histograms and send them via the connection. Stop/Terminate messages are sent after that.
unsigned int m_maximalCompressedSize
Maximal size of the compression buffer.
bool isReady() const override
The is ready is passed from the ZMQConfirmedOutput.
std::string getMonitoringJSON() const final
The monitoring JSON is just passed from the ZMQConfirmedOutput.
void clear()
Nothing to do on clear.
std::vector< zmq::socket_t * > getSockets() const final
The sockets are passed from ZMQConfirmedOutput.
Output connection to speak to non-zmq sockets via a ZMQ_STREAM socket.
EMessageTypes
Type the messages can have.
Abstract base class for different kinds of events.