Belle II Software  release-08-01-10
ZMQSimpleConnection.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/pcore/zmq/connections/ZMQConnection.h>
11 #include <framework/pcore/zmq/utils/ZMQParent.h>
12 
13 #include <framework/pcore/zmq/messages/ZMQIdMessage.h>
14 
15 #include <memory>
16 #include <string>
17 
18 namespace Belle2 {
35  public:
37  ZMQSimpleConnection(const std::string& monitoringAddress, const std::shared_ptr<ZMQParent>& parent);
38 
40  std::unique_ptr<ZMQIdMessage> handleIncomingData();
42  void handleEvent(std::unique_ptr<ZMQIdMessage> message);
43  };
45 }
Specialized connection over a ZMQ socket.
Definition: ZMQConnection.h:62
Connection type to be used for answering simple requests, e.g.
std::unique_ptr< ZMQIdMessage > handleIncomingData()
Block until there is an incoming message and return it as a ZMQIdMessage.
void handleEvent(std::unique_ptr< ZMQIdMessage > message)
Send the given message via the socket (the message includes the identity to send to)
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.
Abstract base class for different kinds of events.