ZeroEQ  0.9.0
ZeroEQ - Zero Event Queue
monitor.h
1 
2 /* Copyright (c) 2017, Human Brain Project
3  * Stefan.Eilemann@epfl.ch
4  */
5 
6 #pragma once
7 
8 #include <zeroeq/receiver.h> // base class
9 
10 namespace zeroeq
11 {
18 class Monitor : public Receiver
19 {
20 public:
22  ZEROEQ_API explicit Monitor(Sender& sender);
23 
25  ZEROEQ_API Monitor(Sender& sender, Receiver& shared);
26 
28  ZEROEQ_API ~Monitor();
29 
31  virtual void notifyNewConnection() {}
32 
33  class Impl;
34 
35 private:
36  std::unique_ptr<Impl> _impl;
37 
38  Monitor(const Monitor&) = delete;
39  Monitor& operator=(const Monitor&) = delete;
40 
41  // Receiver API
42  void addSockets(std::vector<zeroeq::detail::Socket>& entries) final;
43  bool process(zeroeq::detail::Socket& socket) final;
44 };
45 }
~Monitor()
Destroy this monitor.
Monitors a Sender and notifies on events on its socket.
Definition: monitor.h:18
virtual void notifyNewConnection()
Notify of a new connection to the sender.
Definition: monitor.h:31
Base class for entities receiving data.
Definition: receiver.h:38
Publish-subscribe and request-reply.
Definition: client.h:10
Monitor(Sender &sender)
Monitor the given sender.
Interface for entities sending data.
Definition: sender.h:13