Belle II Software development
|
Add the common functionality to the histogram output classes. More...
#include <ZMQHistogramOutput.h>
Public Member Functions | |
template<class... Args> | |
ZMQHistogramOutput (unsigned int maximalUncompressedBufferSize, Args &&... args) | |
Perfectly forward the given arguments to the base class initializer (and init the buffer size) | |
void | handleEvent (std::unique_ptr< ZMQIdMessage > message) |
Handle a new message to be "sent" (what this means is up to the base class) as described above. | |
void | mergeAndSend (EMessageTypes messageType=EMessageTypes::c_eventMessage) |
Forward a merge call to the base class handing over the stored messages. | |
void | clear () |
Forward a clear call to the base class and clear the stored messages. Should be called on run start. | |
Private Attributes | |
unsigned int | m_maximalUncompressedBufferSize |
Paramter for the buffer size (needed during decompression) | |
std::map< std::string, HistogramMapping > | m_storedMessages |
The stored histograms for each sender identity. | |
std::vector< char > | m_uncompressedBuffer |
The buffer used during decompression. | |
std::optional< int > | m_storedExperiment = {} |
If already received: the experiment number of the data (on mismatch, everything is cleared) | |
std::optional< int > | m_storedRun = {} |
If already received: the run number of the data (on mismatch, everything is cleared) | |
Add the common functionality to the histogram output classes.
This histogram output connection itself does not know how to merge or send histograms, everything is implemented in the template class AConnectionClass.
This class just adds the common code on top of those to prevent code duplication. The mergeAndSend calls and the clear call are directly passed on to the parent class. On a message, different things happen depending on the message type:
Data messages are supposed to have the run and experiment number stored as JSON-transformed EventMetaData in the additional messages. This sent event meta data is compared with the already received data. On mismatch, all data is cleared.
Definition at line 55 of file ZMQHistogramOutput.h.
void clear |
Forward a clear call to the base class and clear the stored messages. Should be called on run start.
Definition at line 101 of file ZMQHistogramOutput.cc.
void handleEvent | ( | std::unique_ptr< ZMQIdMessage > | message | ) |
Handle a new message to be "sent" (what this means is up to the base class) as described above.
Definition at line 27 of file ZMQHistogramOutput.cc.
void mergeAndSend | ( | EMessageTypes | messageType = EMessageTypes::c_eventMessage | ) |
Forward a merge call to the base class handing over the stored messages.
Definition at line 95 of file ZMQHistogramOutput.cc.
|
private |
Paramter for the buffer size (needed during decompression)
Definition at line 70 of file ZMQHistogramOutput.h.
|
private |
If already received: the experiment number of the data (on mismatch, everything is cleared)
Definition at line 78 of file ZMQHistogramOutput.h.
|
private |
The stored histograms for each sender identity.
Definition at line 73 of file ZMQHistogramOutput.h.
|
private |
If already received: the run number of the data (on mismatch, everything is cleared)
Definition at line 80 of file ZMQHistogramOutput.h.
|
private |
The buffer used during decompression.
Definition at line 75 of file ZMQHistogramOutput.h.