ZeroEQ  0.6.0
ZeroEQ - Zero Event Queue
broker.h
1 
2 /* Copyright (c) 2014-2015, 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/receiver.h> // base class
10 #include <zeroeq/log.h>
11 
12 namespace zeroeq
13 {
26 namespace connection
27 {
28 namespace detail { class Broker; }
29 
35 class Broker : public Receiver
36 {
37 public:
39  {
42  };
43 
64  ZEROEQ_API Broker( const std::string& name, Receiver& receiver,
65  const PortSelection mode );
66 
81  ZEROEQ_API Broker( const std::string& address, Receiver& receiver );
82 
84  ZEROEQ_API ~Broker();
85 
86  ZEROEQ_API std::string getAddress() const;
87 
88 private:
89  detail::Broker* const _impl;
90 
91  // Receiver API
92  void addSockets( std::vector< zeroeq::detail::Socket >& entries ) final;
93  void process( zeroeq::detail::Socket& socket, uint32_t timeout ) final;
94  void addConnection( const std::string& ) final { ZEROEQDONTCALL; } // LCOV_EXCL_LINE
95 };
96 
97 }
98 }
99 #endif
Brokers subscription requests for a zeroeq::Receiver.
Definition: broker.h:35
Fall back to a random port on failure.
Definition: broker.h:41
Use only the fixed port for named brokers.
Definition: broker.h:40
~Broker()
Destroy this broker.
Broker(const std::string &name, Receiver &receiver, const PortSelection mode)
Convenience constructor to create a new subscription broker.
Base class for entities receiving data.
Definition: receiver.h:33
Publish-subscribe classes for typed events.
Definition: broker.h:12