Node.hh
Go to the documentation of this file.
*brief Advertise a new service without any output parameter *In this version the callback is a free function *param[in] _topic Topic name associated to the service *param[in] _cb Callback to handle the service request with the *following void(*) const AdvertiseServiceOptions _options)
Definition: Node.hh:528
std::vector< std::string > SubscribedTopics() const
Get the list of topics subscribed by this node. Note that we might be interested in one topic but we ...
T bind(T... args)
Definition: AdvertiseOptions.hh:27
STL class.
std::vector< std::string > AdvertisedServices() const
std::vector< std::string > AdvertisedTopics() const
Get the list of topics advertised by this node.
STL class.
std::function< void(const char *_msgData, const size_t _size, const MessageInfo &_info)> RawCallback
Definition: TransportTypes.hh:147
class ignition::transport::Node::Publisher Advertise[in]
void waitForShutdown()
Block the current thread until a SIGINT or SIGTERM is received. Note that this function registers a s...
bool Subscribe(const std::string &_topic, void(*_cb)(const MessageT &_msg), const SubscribeOptions &_opts=SubscribeOptions())
Subscribe to a topic registering a callback. Note that this callback does not include any message inf...
Definition: Node.hh:213
STL class.
bool Valid() const
Return true if valid information, such as a non-empty topic name, is present.
This class stores all the information about a message publisher.
Definition: Publisher.hh:198
bool PublishRaw(const std::string &_msgData, const std::string &_msgType)
Publish a raw pre-serialized message.
bool TopicInfo(const std::string &_topic, std::vector< MessagePublisher > &_publishers) const
this Shared() -> requests.AddHandler(fullyQualifiedTopic, this->NodeUuid(), reqHandlerPtr)
A class to provide different options for a subscription.
Definition: SubscribeOptions.hh:35
*brief Old method for advertising a service This signature is *considered deprecated Please migrate to the callback signature std::function< void(ReplyT &_rep, bool &_result)> const AdvertiseServiceOptions RequestT
Definition: Node.hh:735
A class for customizing the publication options for a topic advertised. E.g.: Set the rate of message...
Definition: AdvertiseOptions.hh:136
bool Unsubscribe(const std::string &_topic)
Unsubscribe from a topic.
bool Subscribe(const std::string &_topic, void(ClassT::*_cb)(const MessageT &_msg), ClassT *_obj, const SubscribeOptions &_opts=SubscribeOptions())
Subscribe to a topic registering a callback. Note that this callback does not include any message inf...
Definition: Node.hh:263
std::vector< std::string > SubscribedTopics() const
Get the list of topics subscribed by this node. Note that we might be interested in one topic but we ...
*brief Advertise a new service without any output parameter *In this version the callback is a free function *param[in] _topic Topic name associated to the service *param[in] _cb Callback to handle the service request with the *following void(* _cb)(const RequestT &_req)
Definition: Node.hh:527
void TopicList(std::vector< std::string > &_topics) const
A class that allows a client to communicate with other peers. There are two main communication modes:...
Definition: Node.hh:64
A class that provides information about the message received.
Definition: MessageInfo.hh:33
std::unique_lock< std::recursive_mutex > lk(this->Shared() ->mutex)
STL class.
std::shared_ptr< ReqHandler< RequestT, ReplyT > > reqHandlerPtr(new ReqHandler< RequestT, ReplyT >(this->NodeUuid()))
It creates a subscription handler for a specific protobuf message. 'T' is the Protobuf message type t...
Definition: SubscriptionHandler.hh:144
void ServiceList(std::vector< std::string > &_services) const
A class for customizing the behavior of the Node. E.g.: Set a custom namespace or a partition name.
Definition: NodeOptions.hh:35
*brief Advertise a new service without any output parameter *In this version the callback is a free function *param[in] _topic Topic name associated to the service *param[in] _cb Callback to handle the service request with the *following void(*) const AdvertiseServiceOptions const ReplyT std::string std::function< void(const RequestT &_req, ReplyT &_rep, bool &_result)> const AdvertiseServiceOptions ReplyT boo Advertise)(const std::string &_topic, std::function< bool(const RequestT &_req, ReplyT &_rep)> &_cb, const AdvertiseServiceOptions &_options=AdvertiseServiceOptions())
Definition: Node.hh:587
static bool FullyQualifiedName(const std::string &_partition, const std::string &_ns, const std::string &_topic, std::string &_name)
Get the full topic path given a namespace and a topic name. A fully qualified topic name's length mus...
bool Subscribe(const std::string &_topic, std::function< void(const MessageT &_msg)> &_cb, const SubscribeOptions &_opts=SubscribeOptions())
Subscribe to a topic registering a callback. Note that this callback does not include any message inf...
Definition: Node.hh:237
cb(_internalRep, _internalResult)
*brief Advertise a new service without any output parameter *In this version the callback is a free function *param[in] _topic Topic name associated to the service *param[in] _cb Callback to handle the service request with the *following void(*) const AdvertiseServiceOptions const ReplyT std::string _topic)
Definition: Node.hh:558
STL class.
bool Subscribe(const std::string &_topic, void(ClassT::*_cb)(const MessageT &_msg, const MessageInfo &_info), ClassT *_obj, const SubscribeOptions &_opts=SubscribeOptions())
Subscribe to a topic registering a callback. Note that this callback includes message information....
Definition: Node.hh:361
T endl(T... args)
A class that is used to store information about an advertised publisher. An instance of this class is...
Definition: Node.hh:84
return this Request(_topic, req, _cb)
bool HasConnections() const
Return true if this publisher has subscribers.
STL namespace.
bool Subscribe(const std::string &_topic, void(*_cb)(const MessageT &_msg, const MessageInfo &_info), const SubscribeOptions &_opts=SubscribeOptions())
Subscribe to a topic registering a callback. Note that this callback includes message information....
Definition: Node.hh:291
Node::Publisher Advertise(const std::string &_topic, const AdvertiseMessageOptions &_options=AdvertiseMessageOptions())
Advertise a new topic. If a topic is currently advertised, you cannot advertise it a second time (reg...
Definition: Node.hh:176
This class stores all the information about a service publisher.
Definition: Publisher.hh:314
const std::string kGenericMessageType
The string type used for generic messages.
Definition: TransportTypes.hh:170
*brief Old method for advertising a service This signature is *considered deprecated Please migrate to the callback signature std::function< void(ReplyT &_rep, bool &_result)> const AdvertiseServiceOptions const ReplyT std::string void(ClassT::*) ClassT _obj)
Definition: Node.hh:739
A class for customizing the publication options for a service advertised.
Definition: AdvertiseOptions.hh:224
bool UnadvertiseSrv(const std::string &_topic)
Addresses_M< ServicePublisher > SrvAddresses_M
Definition: TransportTypes.hh:62
bool Subscribe(const std::string &_topic, std::function< void(const MessageT &_msg, const MessageInfo &_info)> &_cb, const SubscribeOptions &_opts=SubscribeOptions())
Subscribe to a topic registering a callback. Note that this callback includes message information....
Definition: Node.hh:316
bool ServiceInfo(const std::string &_service, std::vector< ServicePublisher > &_publishers) const
[_cb](const ReplyT &_internalRep, const bool _internalResult) {(*_cb)(_internalRep, _internalResult) f
Definition: Node.hh:897
bool Publish(const ProtoMsg &_msg)
Publish a message. This function will copy the message when publishing to interprocess subscribers....
STL class.
std::vector< std::string > AdvertisedTopics() const
Get the list of topics advertised by this node.
return this Request< RequestT, ReplyT >(_topic, _req, f)