ZeroEQ  0.9.0
ZeroEQ - Zero Event Queue
broker.h
1 
2 /* Copyright (c) 2014-2017, Human Brain Project
3  * Stefan.Eilemann@epfl.ch
4  */
5 
6 #ifndef ZEROEQ_CONNECTION_BROKER_H
7 #define ZEROEQ_CONNECTION_BROKER_H
8 
9 #include <zeroeq/log.h>
10 #include <zeroeq/receiver.h> // base class
11 
12 namespace zeroeq
13 {
26 namespace connection
27 {
28 namespace detail
29 {
30 class Broker;
31 }
32 
38 class Broker : public Receiver
39 {
40 public:
42  {
44  PORT_FIXED_OR_RANDOM
45  };
46 
67  ZEROEQ_API Broker(const std::string& name, Receiver& receiver,
68  const PortSelection mode);
69 
84  ZEROEQ_API Broker(const std::string& address, Receiver& receiver);
85 
87  ZEROEQ_API ~Broker();
88 
89  ZEROEQ_API std::string getAddress() const;
90 
91 private:
92  detail::Broker* const _impl;
93 
94  // Receiver API
95  void addSockets(std::vector<zeroeq::detail::Socket>& entries) final;
96  bool process(zeroeq::detail::Socket& socket) final;
97 };
98 }
99 }
100 #endif
Brokers subscription requests for a zeroeq::Receiver.
Definition: broker.h:38
Use only the fixed port for named brokers.
Definition: broker.h:43
Base class for entities receiving data.
Definition: receiver.h:38
Publish-subscribe and request-reply.
Definition: client.h:10