Belle II Software  release-05-02-19
ZMQRxOutputModule.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2018 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Nils Braun, Anselm Baur *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <framework/core/Module.h>
13 #include <framework/datastore/StoreObjPtr.h>
14 #include <framework/dataobjects/EventMetaData.h>
15 #include <framework/core/RandomGenerator.h>
16 #include <framework/pcore/zmq/sockets/ZMQClient.h>
17 #include <framework/pcore/zmq/utils/StreamHelper.h>
18 
19 namespace Belle2 {
29  class ZMQRxOutputModule : public Module {
30  public:
34  void event() override;
36  void initialize() override;
38  void terminate() override;
39 
40  private:
42  bool m_firstEvent = true;
43 
45  unsigned int m_param_maximalWaitingTime;
46 
48  std::string m_param_socketName;
52  std::string m_param_xsubProxySocketName;
57 
62 
67  };
69 }
Belle2::ZMQRxOutputModule::ZMQRxOutputModule
ZMQRxOutputModule()
Constructor setting the moudle paramters.
Definition: ZMQRxOutputModule.cc:12
Belle2::ZMQRxOutputModule::m_param_compressionLevel
int m_param_compressionLevel
Parameter: Compression level of the streamer.
Definition: ZMQRxOutputModule.h:62
Belle2::ZMQRxOutputModule::m_param_xpubProxySocketName
std::string m_param_xpubProxySocketName
Parameter: name of the pub multicast socket.
Definition: ZMQRxOutputModule.h:58
Belle2::ZMQRxOutputModule::m_param_xsubProxySocketName
std::string m_param_xsubProxySocketName
Parameter: name of the sub multicast socket.
Definition: ZMQRxOutputModule.h:60
Belle2::ZMQRxOutputModule::m_eventMetaData
StoreObjPtr< EventMetaData > m_eventMetaData
The event meta data in the data store needed for confirming events.
Definition: ZMQRxOutputModule.h:72
Belle2::StreamHelper
Helper class for data store serialization.
Definition: StreamHelper.h:33
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::StoreObjPtr
Type-safe access to single objects in the data store.
Definition: ParticleList.h:33
Belle2::ZMQRxOutputModule::initialize
void initialize() override
Initialize the streamer.
Definition: ZMQRxOutputModule.cc:25
Belle2::ZMQRxOutputModule::m_zmqClient
ZMQClient m_zmqClient
Our ZMQ client.
Definition: ZMQRxOutputModule.h:67
Belle2::ZMQRxOutputModule::m_firstEvent
bool m_firstEvent
Set to false if the objects are initialized.
Definition: ZMQRxOutputModule.h:50
Belle2::ZMQRxOutputModule::terminate
void terminate() override
Terminate the client and tell the monitor, we are done.
Definition: ZMQRxOutputModule.cc:96
Belle2::ZMQRxOutputModule::event
void event() override
Receive an event and store it in the datastore. Confirm to the input process.
Definition: ZMQRxOutputModule.cc:30
Belle2::ZMQRxOutputModule::m_randomgenerator
StoreObjPtr< RandomGenerator > m_randomgenerator
The random generator in the data store.
Definition: ZMQRxOutputModule.h:74
Belle2::ZMQRxOutputModule::m_param_maximalWaitingTime
unsigned int m_param_maximalWaitingTime
Maximal time to wait until aborting in ms.
Definition: ZMQRxOutputModule.h:53
Belle2::ZMQRxOutputModule::m_streamer
StreamHelper m_streamer
The data store streamer.
Definition: ZMQRxOutputModule.h:69
Belle2::ZMQRxOutputModule::m_param_handleMergeable
bool m_param_handleMergeable
Parameter: Can we handle mergeables?
Definition: ZMQRxOutputModule.h:64
Belle2::ZMQClient
A helper class for communicating over ZMQ. Includes a multicast and (if needed) also a data socket.
Definition: ZMQClient.h:32
Belle2::ZMQRxOutputModule::m_param_socketName
std::string m_param_socketName
Parameter: name of the data socket.
Definition: ZMQRxOutputModule.h:56