Belle II Software  release-05-02-19
ZMQSimpleConnection.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 <framework/pcore/zmq/connections/ZMQConnection.h>
13 #include <framework/pcore/zmq/utils/ZMQParent.h>
14 
15 #include <framework/pcore/zmq/messages/ZMQIdMessage.h>
16 
17 #include <memory>
18 #include <string>
19 
20 namespace Belle2 {
36  class ZMQSimpleConnection : public ZMQConnectionOverSocket {
37  public:
39  ZMQSimpleConnection(const std::string& monitoringAddress, const std::shared_ptr<ZMQParent>& parent);
40 
42  std::unique_ptr<ZMQIdMessage> handleIncomingData();
44  void handleEvent(std::unique_ptr<ZMQIdMessage> message);
45  };
47 }
Belle2::ZMQSimpleConnection::handleEvent
void handleEvent(std::unique_ptr< ZMQIdMessage > message)
Send the given message via the socket (the message includes the identity to send to)
Definition: ZMQSimpleConnection.cc:29
Belle2::ZMQSimpleConnection::handleIncomingData
std::unique_ptr< ZMQIdMessage > handleIncomingData()
Block until there is an incoming message and return it as a ZMQIdMessage.
Definition: ZMQSimpleConnection.cc:23
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::ZMQSimpleConnection::ZMQSimpleConnection
ZMQSimpleConnection(const std::string &monitoringAddress, const std::shared_ptr< ZMQParent > &parent)
Create a new simple connection with a ZMQ_ROUTER socket binding to the given address.
Definition: ZMQSimpleConnection.cc:15