18 #ifndef IGN_TRANSPORT_NODESHARED_HH_
19 #define IGN_TRANSPORT_NODESHARED_HH_
22 #pragma warning(push, 0)
24 #include <google/protobuf/message.h>
62 public:
void RunReceptionTask();
69 public:
bool Publish(
const std::string &_topic,
70 const std::string &_data,
71 const std::string &_msgType);
74 public:
void RecvMsgUpdate();
78 public:
void RecvControlUpdate();
81 public:
void RecvSrvRequest();
84 public:
void RecvSrvResponse();
91 public:
void SendPendingRemoteReqs(
const std::string &_topic,
92 const std::string &_reqType,
93 const std::string &_repType);
120 private:
bool InitializeSockets();
123 public:
static const int Timeout = 250;
151 public:
bool threadReceptionExiting;
156 private:
const int kMsgDiscPort = 11317;
159 private:
const int kSrvDiscPort = 11318;
162 private: std::mutex exitMutex;
168 private: std::vector<std::string> srvConnections;
206 public: std::unique_ptr<zmq::context_t>
context;
219 public: std::unique_ptr<zmq::socket_t>
control;
228 public: std::unique_ptr<zmq::socket_t>
replier;
std::thread threadReception
thread in charge of receiving and handling incoming messages.
Definition: NodeShared.hh:142
Uuid replierId
Replier socket identity.
Definition: NodeShared.hh:133
std::unique_ptr< zmq::socket_t > control
ZMQ socket to receive control updates (new connections, ...).
Definition: NodeShared.hh:219
std::string hostAddr
IP address of this host.
Definition: NodeShared.hh:198
std::unique_ptr< zmq::socket_t > responseReceiver
ZMQ socket for receiving service call responses.
Definition: NodeShared.hh:225
Uuid responseReceiverId
Response receiver socket identity.
Definition: NodeShared.hh:130
int timeout
Timeout used for receiving requests.
Definition: NodeShared.hh:139
std::string myControlAddress
My pub/sub control address.
Definition: NodeShared.hh:189
HandlerStorage< IReqHandler > requests
Pending service call requests.
Definition: NodeShared.hh:180
std::string myReplierAddress
My replier service call address.
Definition: NodeShared.hh:195
bool exit
When true, the reception thread will finish.
Definition: NodeShared.hh:148
TopicStorage< MessagePublisher > remoteSubscribers
Remote subscribers.
Definition: NodeShared.hh:171
std::unique_ptr< SrvDiscovery > srvDiscovery
Discovery service (services).
Definition: NodeShared.hh:238
std::unique_ptr< zmq::socket_t > replier
ZMQ socket to receive service call requests.
Definition: NodeShared.hh:228
ignition/transport/HandlerStorage.hh
Definition: HandlerStorage.hh:33
Private data for the Node class.
Definition: NodeShared.hh:54
A portable class for representing a Universally Unique Identifier.
Definition: Uuid.hh:41
std::unique_ptr< zmq::socket_t > subscriber
ZMQ socket to receive topic updates.
Definition: NodeShared.hh:216
std::unique_ptr< zmq::socket_t > requester
ZMQ socket for sending service call requests.
Definition: NodeShared.hh:222
std::string myAddress
My pub/sub address.
Definition: NodeShared.hh:186
std::unique_ptr< zmq::socket_t > publisher
ZMQ socket to send topic updates.
Definition: NodeShared.hh:213
#define IGNITION_TRANSPORT_VISIBLE
Use to represent "symbol visible" if supported.
Definition: Helpers.hh:57
ignition/transport/Publisher.hh
Definition: Publisher.hh:198
ignition/transport/Publisher.hh
Definition: Publisher.hh:314
HandlerStorage< ISubscriptionHandler > localSubscriptions
Subscriptions.
Definition: NodeShared.hh:174
std::unique_ptr< MsgDiscovery > msgDiscovery
Discovery service (messages).
Definition: NodeShared.hh:235
std::string myRequesterAddress
My requester service call address.
Definition: NodeShared.hh:192
std::unique_ptr< zmq::context_t > context
0MQ context.
Definition: NodeShared.hh:206
Store address information about topics and provide convenient methods for adding new topics...
Definition: TopicStorage.hh:37
std::string pUuid
Process UUID.
Definition: NodeShared.hh:136
int verbose
Print activity to stdout.
Definition: NodeShared.hh:183
HandlerStorage< IRepHandler > repliers
Service call repliers.
Definition: NodeShared.hh:177
std::recursive_mutex mutex
Mutex to guarantee exclusive access between all threads.
Definition: NodeShared.hh:145