ZeroEQ  0.9.0
ZeroEQ - Zero Event Queue
receiver.h
1 
2 /* Copyright (c) 2014-2017, Human Brain Project
3  * Stefan.Eilemann@epfl.ch
4  */
5 
6 #ifndef ZEROEQ_RECEIVER_H
7 #define ZEROEQ_RECEIVER_H
8 
9 #include <zeroeq/api.h>
10 #include <zeroeq/types.h>
11 
12 #include <memory>
13 
14 #include <string>
15 #include <vector>
16 
17 namespace zeroeq
18 {
19 namespace connection
20 {
21 namespace detail
22 {
23 class Broker;
24 }
25 }
26 
38 class Receiver
39 {
40 public:
42  ZEROEQ_API Receiver();
43 
52  ZEROEQ_API explicit Receiver(Receiver& shared);
53 
54  ZEROEQ_API virtual ~Receiver();
55  ZEROEQ_API Receiver(Receiver&&);
56  ZEROEQ_API Receiver& operator=(Receiver&&);
57 
68  ZEROEQ_API bool receive(const uint32_t timeout = TIMEOUT_INDEFINITE);
69 
70 protected:
72  virtual void addSockets(std::vector<detail::Socket>& entries) = 0;
73 
81  virtual bool process(detail::Socket& socket) = 0;
82 
89  virtual void update() {}
90 
96  ZEROEQ_API virtual void addConnection(const std::string& uri);
97  friend class connection::detail::Broker;
98 
99 private:
100  Receiver& operator=(const Receiver&) = delete;
101 
102  class Impl;
103  std::shared_ptr<Impl> _impl;
104 };
105 }
106 
107 #endif
Defines export visibility macros for library ZeroEQ.
static const uint32_t TIMEOUT_INDEFINITE
Constant defining &#39;wait forever&#39; in methods with wait parameters.
Definition: types.h:78
Base class for entities receiving data.
Definition: receiver.h:38
Publish-subscribe and request-reply.
Definition: client.h:10
virtual void update()
Update the internal connection list.
Definition: receiver.h:89