Belle II Software  release-05-02-19
ZMQClasses.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2019 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Nils Braun *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <daq/hbasf2/apps/ZMQApp.h>
13 #include <framework/pcore/zmq/connections/ZMQConfirmedConnection.h>
14 #include <framework/pcore/zmq/connections/ZMQLoadBalancedConnection.h>
15 #include <framework/pcore/zmq/connections/ZMQRawConnection.h>
16 #include <framework/pcore/zmq/connections/ZMQNullConnection.h>
17 
18 namespace Belle2 {
28  class ZMQReadySender : public ZMQStandardApp<ZMQLoadBalancedInput, ZMQNullConnection> {
29  protected:
31  void initialize() final;
33  void addOptions(po::options_description& desc) final;
34 
35  private:
37  std::string m_inputAddress;
39  unsigned int m_bufferSize = 20;
40  };
41 
48  protected:
50  void initialize() final;
52  void addOptions(po::options_description& desc) final;
53 
54  private:
56  std::string m_inputAddress;
57  };
58 
65  class ZMQWorker : public ZMQStandardApp<ZMQLoadBalancedInput, ZMQConfirmedOutput> {
66  protected:
68  void initialize() final;
70  void addOptions(po::options_description& desc) final;
72  void handleInput() final;
73 
74  private:
76  std::string m_inputAddress;
78  std::string m_outputAddress;
80  unsigned int m_bufferSize = 20;
81  };
83 }
Belle2::ZMQAcceptor
App to only send a confirmation on every incoming message - behaves the same as the input of a (final...
Definition: ZMQClasses.h:55
Belle2::ZMQStandardApp
Generic base class for all standalone ZMQ applications.
Definition: ZMQApp.h:56
Belle2::ZMQReadySender::initialize
void initialize() final
Initialize the two connections using the command line arguments.
Definition: ZMQClasses.cc:15
Belle2::ZMQWorker
App to mimick a basf2-worker by accepting an incoming message with a ready message and sending it out...
Definition: ZMQClasses.h:73
Belle2::ZMQConfirmedInput
Input part of a confirmed connection.
Definition: ZMQConfirmedConnection.h:65
Belle2::ZMQReadySender::m_inputAddress
std::string m_inputAddress
Parameter: input address.
Definition: ZMQClasses.h:45
Belle2::ZMQStandardApp< ZMQLoadBalancedInput, ZMQNullConnection >::handleInput
virtual void handleInput()
Will get called for every message on the input connection. Can be overridden in a derived class....
Definition: ZMQApp.details.h:146
Belle2::ZMQNullConnection
Connection doing just nothing: without the capability to pull, send or receive. Useful for template i...
Definition: ZMQNullConnection.h:31
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::ZMQReadySender::m_bufferSize
unsigned int m_bufferSize
Parameter: buffer size.
Definition: ZMQClasses.h:47
Belle2::ZMQReadySender::addOptions
void addOptions(po::options_description &desc) final
Add the parameters to the cmd line arguments.
Definition: ZMQClasses.cc:22