Belle II Software development
HLTZMQ2DsDirect.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#pragma once
9
10#include <framework/core/Module.h>
11
12#include <daq/hbasf2/utils/HLTStreamHelper.h>
13#include <framework/pcore/zmq/connections/ZMQLoadBalancedConnection.h>
14
15#include <framework/pcore/zmq/utils/ZMQParent.h>
16
17#include <memory>
18#include <string>
19
20namespace Belle2 {
31 public:
34
36 void initialize() override;
38 void event() override;
39
40 private:
42 std::shared_ptr<ZMQParent> m_parent;
44 std::unique_ptr<ZMQLoadBalancedInput> m_input;
45
48
50 bool m_firstEvent = true;
51
53 std::string m_param_input;
55 unsigned int m_param_bufferSize = 20;
56
57 void readEvent();
58 };
60}
Helper class for data store serialization.
Special ZMQ2Ds module without the HLT-specific handling of initialization and begin/end run.
bool m_firstEvent
Are we still in the first real event?
std::unique_ptr< ZMQLoadBalancedInput > m_input
Load balanced connection to the previous ZMQ application.
void initialize() override
Receive the first event and initialize the data store with it.
HLTZMQ2DsDirectModule()
Register the module parameters.
void event() override
If not in the first event, receive an event and store in the DS.
std::shared_ptr< ZMQParent > m_parent
ZMQ Parent needed for the connections.
unsigned int m_param_bufferSize
Module parameter: how many events should be kept in flight. Has an impact on the stopping time as wel...
HLTStreamHelper m_streamHelper
Utility class for deserialization.
std::string m_param_input
Module parameter: ZMQ address of the input ZMQ application.
Base class for Modules.
Definition: Module.h:72
Abstract base class for different kinds of events.