salsa  0.3.0
 All Classes Functions Variables Enumerations Pages
NodeZyre.hh
1 #pragma once
2 
3 #include <ActorZmq.hh>
4 #include <MessageZyre.hh>
5 #include <Node.hh>
6 
7 #include <PollerZmq.hh>
8 #include <SocketZyre.hh>
9 
10 namespace Salsa {
19 class NodeManagerZyre;
20 class NodeZyre : public Node, public ActorZmq {
21 public:
23  NodeZyre(std::string name = "");
25  virtual ~NodeZyre();
26 
27  virtual int init();
28  virtual int exec();
29  virtual int finish();
30 
31  void addSocket(std::shared_ptr<SocketZyre> socket);
32  std::vector<std::shared_ptr<SocketZyre>> sockets() const;
33  void addSocket(zsock_t * pSocket);
34 
35  void handleZmq(zmsg_t * pMsg);
36 
37 private:
38  std::vector<std::shared_ptr<SocketZyre>> mSockets{};
39  std::vector<zsock_t *> mZmqSockets{};
41 };
42 
43 } // namespace Salsa
virtual ~NodeZyre()
Destruct Zyre node.
Definition: NodeZyre.cc:16
virtual int init()
First function.
Definition: NodeZyre.cc:37
void handleZmq(zmsg_t *pMsg)
Definition: NodeZyre.cc:231
std::vector< std::shared_ptr< SocketZyre > > sockets() const
Definition: NodeZyre.cc:213
virtual int exec()
Main function.
Definition: NodeZyre.cc:75
virtual int finish()
Last function.
Definition: NodeZyre.cc:185
Base Node class.
Definition: Node.hh:22
NodeZyre(std::string name="")
Construct Zyre node with provided name (and packetizer)
Definition: NodeZyre.cc:9
std::vector< zsock_t * > mZmqSockets
List of zmq sockets.
Definition: NodeZyre.hh:39
ZeroMQ implementation of salsa actor class.
Definition: ActorZmq.hh:19
void addSocket(std::shared_ptr< SocketZyre > socket)
Definition: NodeZyre.cc:198
std::vector< std::shared_ptr< SocketZyre > > mSockets
List of zyre sockets.
Definition: NodeZyre.hh:38
salsa node class
Definition: NodeZyre.hh:20
NodeManagerZyre class.
std::string name() const
Returns node name.
Definition: Node.hh:34
NodeManagerZyre * mpNodeManager
Job manager.
Definition: NodeZyre.hh:40