Belle II Software development
|
Special form of the ZMQFinalCollector for sending out the additional data message to a ROI receiver. More...
#include <ZMQCollector.h>
Public Member Functions | |
void | initFromConsole (const std::string &description, int argc, char *argv[]) |
Should be called before the main() function to initialize the connections using the paremeters given on command line. | |
void | main () |
Start the main loop polling on the output and monitoring connections and eventually also on the input if the output is ready. | |
Protected Member Functions | |
void | initialize () final |
Initialize the two connections using the command line arguments. | |
void | addOptions (po::options_description &desc) final |
Add the parameters to the cmd line arguments. | |
void | handleExternalSignal (EMessageTypes type) final |
Set the stop message counter on stop or clear the counters on start from the monitoring connection. | |
void | handleInput () final |
Pass the message from the input connection to the output connection (data message to first, additional data message to second address) | |
void | fillMonitoringJSON (std::stringstream &buffer) const final |
Special handling of the JSON function with additonal ROI. | |
void | handleTimeout () final |
When a timeout is set (= we are waiting for all messages after a stop), send a stop message once we have not seen any more events. | |
virtual void | handleOutput () |
Will get called for every message on the output connection. Can be overridden in a derived class. Calls handleIncomingData by default. | |
bool | terminated () const |
Check if the main loop will be exited on next occasion. Can be set via the "m_terminate" flag. | |
void | resetTimer () |
Helper function to reset the start time and the remaining time. | |
void | pollEvent (bool pollOnInput) |
Poll until a single event is retreived. | |
Protected Attributes | |
std::shared_ptr< ZMQParent > | m_parent |
Pointer to the ZMQParent to be used as base for all connections. | |
std::unique_ptr< ZMQConfirmedInput > | m_input |
Pointer to the input connection. Should be set in initialize. | |
std::unique_ptr< ZMQDataAndROIOutput > | m_output |
Pointer to the output connection. Should be set in initialize. | |
std::unique_ptr< ZMQSimpleConnection > | m_monitor |
Pointer to the monitoring connection. Should be set in initialize. | |
bool | m_terminate |
Can be set by functions to terminate the main loop at the next possibility. | |
unsigned int | m_timeout |
If set to a value != 0, will call handleTimeout with this frequency (in seconds). | |
bool | m_monitorHasPriority |
Flag to break out of the polling loop to check for monitoring messages. Except for the finalcollector you probably do not want this. | |
Private Member Functions | |
bool | checkTimer () |
Helper function to check, if the timeout should happen. | |
void | updateTimer () |
Helper function to update the remaining time. | |
void | handleMonitoring () |
Handle an incoming message on the monitoring socket by either calling handleExternalSignal() or by passing on the monitor JSONs of the connections. | |
Private Attributes | |
std::string | m_inputAddress |
Parameter: input address. | |
std::string | m_dataOutputAddress |
Parameter: output address for data (first part of message) | |
std::string | m_roiOutputAddress |
Parameter: output address for ROIs (second part of message) | |
bool | m_addEventSize |
Parameter: add the event size at the beginning of the message. | |
unsigned int | m_stopWaitingTime = 2 |
Parameter: how long to wait after no events come anymore. | |
HLTMainLoop | m_mainLoop |
Internal signal handler. | |
std::string | m_monitoringAddress |
Storage for the monitoring address for the cmd arguments. | |
int | m_remainingTime |
Counter for the remaining time until a timeout happens. | |
std::chrono::system_clock::time_point | m_start |
Start time for the timeout. | |
Special form of the ZMQFinalCollector for sending out the additional data message to a ROI receiver.
Definition at line 142 of file ZMQCollector.h.
|
finalprotectedvirtual |
Add the parameters to the cmd line arguments.
Reimplemented from ZMQStandardApp< ZMQConfirmedInput, ZMQDataAndROIOutput >.
Definition at line 234 of file ZMQCollector.cc.
|
privateinherited |
Helper function to check, if the timeout should happen.
Definition at line 111 of file ZMQApp.details.h.
|
finalprotectedvirtual |
Special handling of the JSON function with additonal ROI.
Reimplemented from ZMQStandardApp< ZMQConfirmedInput, ZMQDataAndROIOutput >.
Definition at line 289 of file ZMQCollector.cc.
|
finalprotectedvirtual |
Set the stop message counter on stop or clear the counters on start from the monitoring connection.
Reimplemented from ZMQStandardApp< ZMQConfirmedInput, ZMQDataAndROIOutput >.
Definition at line 278 of file ZMQCollector.cc.
|
finalprotectedvirtual |
Pass the message from the input connection to the output connection (data message to first, additional data message to second address)
Reimplemented from ZMQStandardApp< ZMQConfirmedInput, ZMQDataAndROIOutput >.
Definition at line 260 of file ZMQCollector.cc.
|
privateinherited |
Handle an incoming message on the monitoring socket by either calling handleExternalSignal() or by passing on the monitor JSONs of the connections.
Definition at line 115 of file ZMQApp.details.h.
|
protectedvirtualinherited |
Will get called for every message on the output connection. Can be overridden in a derived class. Calls handleIncomingData by default.
Definition at line 88 of file ZMQApp.details.h.
|
finalprotectedvirtual |
When a timeout is set (= we are waiting for all messages after a stop), send a stop message once we have not seen any more events.
Reimplemented from ZMQStandardApp< ZMQConfirmedInput, ZMQDataAndROIOutput >.
Definition at line 299 of file ZMQCollector.cc.
|
inherited |
Should be called before the main() function to initialize the connections using the paremeters given on command line.
Custom implementations should implement the addOptions function to pass the command line arguments correctly. Calls the initialize function (which should also be overridden).
Definition at line 54 of file ZMQApp.details.h.
|
finalprotectedvirtual |
Initialize the two connections using the command line arguments.
Reimplemented from ZMQStandardApp< ZMQConfirmedInput, ZMQDataAndROIOutput >.
Definition at line 251 of file ZMQCollector.cc.
|
inherited |
Start the main loop polling on the output and monitoring connections and eventually also on the input if the output is ready.
Calls the functions handleExternalSignal, handleInput, handleOutput and handleTimeout as described in the documentation of this class.
Definition at line 61 of file ZMQApp.details.h.
|
protectedinherited |
Poll until a single event is retreived.
Definition at line 98 of file ZMQApp.details.h.
|
protectedinherited |
Helper function to reset the start time and the remaining time.
Definition at line 96 of file ZMQApp.details.h.
|
protectedinherited |
Check if the main loop will be exited on next occasion. Can be set via the "m_terminate" flag.
Definition at line 94 of file ZMQApp.details.h.
|
privateinherited |
Helper function to update the remaining time.
Definition at line 113 of file ZMQApp.details.h.
|
private |
Parameter: add the event size at the beginning of the message.
Definition at line 165 of file ZMQCollector.h.
|
private |
Parameter: output address for data (first part of message)
Definition at line 161 of file ZMQCollector.h.
|
protectedinherited |
|
private |
Parameter: input address.
Definition at line 159 of file ZMQCollector.h.
|
privateinherited |
|
protectedinherited |
|
protectedinherited |
|
privateinherited |
|
protectedinherited |
|
protectedinherited |
|
privateinherited |
|
private |
Parameter: output address for ROIs (second part of message)
Definition at line 163 of file ZMQCollector.h.
|
privateinherited |
|
private |
Parameter: how long to wait after no events come anymore.
Definition at line 167 of file ZMQCollector.h.
|
protectedinherited |
|
protectedinherited |