Ignition Transport

API Reference

4.0.0
ignition::transport Namespace Reference

Classes

class  AdvertiseMessage
 Advertise packet used in the discovery protocol to broadcast information about the node advertising a topic. The information sent contains the name of the protobuf message type advertised. This message is used for advertising messages and services. 'T' is the Publisher type used inside this AdvertiseMessage object. More...
 
class  AdvertiseMessageOptions
 A class for customizing the publication options for a topic advertised. E.g.: Set the rate of messages per second published. More...
 
class  AdvertiseOptions
 A class for customizing the publication options for a topic or service advertised. E.g.: Set the scope of a topic/service. More...
 
class  AdvertiseServiceOptions
 A class for customizing the publication options for a service advertised. More...
 
class  Discovery
 A discovery class that implements a distributed topic discovery protocol. It uses UDP multicast for sending/receiving messages and stores updated topic information. The discovery clients can request the discovery of a topic or the advertisement of a local topic. The discovery uses heartbeats to track the state of other peers in the network. The discovery clients can register callbacks to detect when new topics are discovered or topics are no longer available. More...
 
class  HandlerStorage
 Class to store and manage service call handlers. More...
 
class  Header
 Header included in each discovery message containing the version of the discovery protocol, the process UUID of the sender node, the type. More...
 
class  IRepHandler
 Interface class used to manage a replier handler. More...
 
class  IReqHandler
 Interface class used to manage a request handler. More...
 
class  ISubscriptionHandler
 Interface class used to manage generic protobuf messages. More...
 
class  MessageInfo
 A class that provides information about the message received. More...
 
class  MessagePublisher
 This class stores all the information about a message publisher. More...
 
class  Node
 A class that allows a client to communicate with other peers. There are two main communication modes: pub/sub messages and service calls. More...
 
class  NodeOptions
 A class for customizing the behavior of the Node. E.g.: Set a custom namespace or a partition name. More...
 
class  NodeShared
 Private data for the Node class. This class should not be directly used. You should use the Node class. More...
 
class  Publisher
 This class stores all the information about a publisher. It stores the topic name that publishes, addresses, UUIDs, scope, etc. More...
 
class  RawSubscriptionHandler
 
class  RepHandler
 with the service response. More...
 
class  ReqHandler
 It creates a reply handler for the specific protobuf messages used. 'Req' is a protobuf message type containing the input parameters of the service request. 'Rep' is a protobuf message type that will be filled with the service response. More...
 
class  ReqHandler< google::protobuf::Message, google::protobuf::Message >
 
class  ServicePublisher
 This class stores all the information about a service publisher. More...
 
class  SubscribeOptions
 A class to provide different options for a subscription. More...
 
class  SubscriptionHandler
 It creates a subscription handler for a specific protobuf message. 'T' is the Protobuf message type that will be used for this particular handler. More...
 
class  SubscriptionHandler< ProtoMsg >
 Specialized template when the user prefers a callbacks that accepts a generic google::protobuf::message instead of a specific type. More...
 
class  SubscriptionHandlerBase
 SubscriptionHandlerBase contains functions and data which are common to all SubscriptionHandler types. More...
 
class  SubscriptionMsg
 Subscription packet used in the discovery protocol for requesting information about a given topic. More...
 
class  TopicStorage
 Store address information about topics and provide convenient methods for adding new topics, removing them, etc. More...
 
class  TopicUtils
 This class provides different utilities related with topics. More...
 
class  Uuid
 A portable class for representing a Universally Unique Identifier. More...
 

Typedefs

template<typename T >
using Addresses_M = std::map< std::string, std::vector< T > >
 
using DeallocFunc = void(void *_data, void *_hint)
 
template<typename T >
using DiscoveryCallback = std::function< void(const T &_publisher)>
 
using f = [_cb](const ReplyT &_internalRep, const bool _internalResult) {(*_cb)(_internalRep, _internalResult)
 
using IRepHandlerPtr = std::shared_ptr< IRepHandler >
 
using IReqHandler_M = std::map< std::string, std::map< std::string, IReqHandlerPtr > >
 
using IReqHandlerPtr = std::shared_ptr< IReqHandler >
 
using ISubscriptionHandler_M = std::map< std::string, ISubscriptionHandlerPtr >
 
using ISubscriptionHandlerPtr = std::shared_ptr< ISubscriptionHandler >
 
using MsgAddresses_M = Addresses_M< MessagePublisher >
 
template<typename T >
using MsgCallback = std::function< void(const T &_msg, const MessageInfo &_info)>
 
using MsgDiscovery = Discovery< MessagePublisher >
 
using MsgDiscoveryCallback = std::function< void(const MessagePublisher &_publisher)>
 
using ProtoMsg = google::protobuf::Message
 
using ProtoMsgPtr = std::shared_ptr< ProtoMsg >
 
using RawCallback = std::function< void(const char *_msgData, const size_t _size, const MessageInfo &_info)>
 
using RawSubscriptionHandler_M = std::map< std::string, RawSubscriptionHandlerPtr >
 
using RawSubscriptionHandlerPtr = std::shared_ptr< RawSubscriptionHandler >
 
using SrvAddresses_M = Addresses_M< ServicePublisher >
 
using SrvDiscovery = Discovery< ServicePublisher >
 
using SrvDiscoveryCallback = std::function< void(const ServicePublisher &_publisher)>
 
using Timestamp = std::chrono::steady_clock::time_point
 

Enumerations

enum class  Scope_t { PROCESS , HOST , ALL }
 

Functions

*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 ReplyT const std::string void(ClassT::*) _cb (const RequestT &_req, ReplyT &_rep, bool &_result)
 
class ignition::transport::Node Advertise (const std::string &_topic, bool(*_cb)(ReplyT &_rep), const AdvertiseServiceOptions &_options=AdvertiseServiceOptions())
 
*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 ReplyT const std::string void(ClassT::*) ClassT const AdvertiseServiceOptions ReplyT bool Advertise (const std::string &_topic, bool(ClassT::*_cb)(const RequestT &_req, ReplyT &_rep), ClassT *_obj, const AdvertiseServiceOptions &_options=AdvertiseServiceOptions())
 
*brief Advertise a new service without any output parameter *In this version the callback is a member function *param[in] _topic Topic name associated to the service *param[in] _cb Callback to handle the service request with the *following RequestT bool Advertise (const std::string &_topic, void(ClassT::*_cb)(const RequestT &_req), ClassT *_obj, const AdvertiseServiceOptions &_options=AdvertiseServiceOptions())
 
std::vector< std::stringAdvertisedServices () const
 
 cb (_internalRep, _internalResult)
 
std::string determineHost ()
 Determine IP or hostname. Reference: https://github.com/ros/ros_comm/blob/hydro-devel/clients/ roscpp/src/libros/network.cpp.
 
std::vector< std::stringdetermineInterfaces ()
 Determine the list of network interfaces for this machine. Reference: https://github.com/ros/ros_comm/blob/hydro-devel/clients/ roscpp/src/libros/network.cpp.
 
bool env (const std::string &_name, std::string &_value)
 Find the environment variable '_name' and return its value.
 
std::string hostname ()
 Determine the computer's hostname.
 
int hostnameToIp (char *_hostname, std::string &_ip)
 Determine if an IP is private.
 
 if (!_rep.ParseFromString(reqHandlerPtr->Response()))
 
 if (!executed) return false
 
 if (!reqHandlerPtr->Result())
 
 if (!TopicUtils::FullyQualifiedName(this->Options().Partition(), this->Options().NameSpace(), _topic, fullyQualifiedTopic))
 
 if (localResponserFound)
 
 if (this->Shared() ->repliers.FirstHandler(fullyQualifiedTopic, _req.GetTypeName(), _rep.GetTypeName(), repHandler))
 
 if (this->Shared() ->TopicPublishers(fullyQualifiedTopic, addresses))
 
bool isPrivateIP (const char *_ip)
 Determine if an IP is private. Reference: https://github.com/ros/ros_comm/blob/hydro-devel/clients/ roscpp/src/libros/network.cpp.
 
std::unique_lock< std::recursive_mutexlk (this->Shared() ->mutex)
 
bool pollSockets (const std::vector< int > &_sockets, const int _timeout)
 
return this Request (_topic, req, _cb)
 
return this Request (_topic, req, _cb, _obj)
 
return this Request (_topic, req, _timeout, _rep, _result)
 
template<typename RequestT >
bool Request (const std::string &_topic, const RequestT &_req)
 
return this Request< RequestT, ReplyT > (_topic, _req, f)
 
bool ServiceInfo (const std::string &_service, std::vector< ServicePublisher > &_publishers) const
 
void ServiceList (std::vector< std::string > &_services) const
 
reqHandlerPtr SetCallback (_cb)
 
this Shared () -> requests.AddHandler(fullyQualifiedTopic, this->NodeUuid(), reqHandlerPtr)
 
bool TopicInfo (const std::string &_topic, std::vector< MessagePublisher > &_publishers) const
 
void TopicList (std::vector< std::string > &_topics) const
 
bool UnadvertiseSrv (const std::string &_topic)
 
std::string username ()
 Determine your login name.
 
void waitForShutdown ()
 Block the current thread until a SIGINT or SIGTERM is received. Note that this function registers a signal handler. Do not use this function if you want to manage yourself SIGINT/SIGTERM.
 

Variables

*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)
 
*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 ReplyT const std::string void(ClassT::*) ClassT _obj )
 
*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 )
 
reqHandlerPtr SetResponse & _rep
 
reqHandlerPtr SetMessage & _req
 
 _result = true
 
*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 ReplyT const std::string _topic )
 
SrvAddresses_M addresses
 
*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 ReplyT const 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())
 
static const uint8_t AdvType = 1
 
*brief Subscribe to a topic registering a callback The callback must *accept a std::string to represent the message and a MessageInfo *which provides metadata about the message *param[in] _topic Name of the topic to subscribe to *param[in] _callback A function pointer or std::function object that *has a void return value and accepts two arguments
 
static const uint8_t ByeType = 5
 
*brief Old method for advertising a service This signature is *considered deprecated Please migrate to the callback signature * code
 
*brief Get the list of topics currently advertised in the network *Note that this function can block for some time if the *discovery is in its initialization phase *The value of the heartbeatInterval constant
 
*brief Subscribe to a topic registering a callback The callback must *accept a std::string to represent the message data
 
 else
 
static const uint8_t EndConnection = 7
 
static const uint8_t HeartbeatType = 4
 
const std::string kGenericMessageType = "google.protobuf.Message"
 The string type used for generic messages.
 
static const uint64_t kUnthrottled = std::numeric_limits<uint64_t>::max()
 Constant used when not interested in throttling.
 
bool localResponserFound
 
*brief Get the list of topics currently advertised in the network *Note that this function can block for some time if the *discovery is in its initialization phase *The value of the heartbeatInterval with a default *value of ms
 
static const std::vector< std::stringMsgTypesStr
 Used for debugging the message type received/send.
 
static const uint8_t NewConnection = 6
 
*brief Get the list of topics currently advertised in the network *Note that this function can block for some time if the *discovery is in its initialization phase *The value of the heartbeatInterval with a default *value of
 
*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 parameters
 
IRepHandlerPtr repHandler
 
std::shared_ptr< ReqHandler< RequestT, ReplyT > > reqHandlerPtr (new ReqHandler< RequestT, ReplyT >(this->NodeUuid()))
 
*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
 
static const uint8_t SubType = 2
 
return true
 
static const uint8_t UnadvType = 3
 
static const uint8_t Uninitialized = 0
 

Typedef Documentation

◆ Addresses_M

template<typename T >
using Addresses_M = std::map<std::string, std::vector<T> >

◆ DeallocFunc

using DeallocFunc = void(void *_data, void *_hint)

◆ DiscoveryCallback

template<typename T >
using DiscoveryCallback = std::function<void(const T &_publisher)>

◆ f

using f = [_cb, _obj](const ReplyT &_internalRep, const bool _internalResult) { auto cb = std::bind(_cb, _obj, std::placeholders::_1, std::placeholders::_2)

◆ IRepHandlerPtr

◆ IReqHandler_M

◆ IReqHandlerPtr

◆ ISubscriptionHandler_M

◆ ISubscriptionHandlerPtr

◆ MsgAddresses_M

◆ MsgCallback

template<typename T >
using MsgCallback = std::function<void(const T &_msg, const MessageInfo &_info)>

◆ MsgDiscovery

◆ MsgDiscoveryCallback

using MsgDiscoveryCallback = std::function<void(const MessagePublisher &_publisher)>

◆ ProtoMsg

using ProtoMsg = google::protobuf::Message

◆ ProtoMsgPtr

◆ RawCallback

using RawCallback = std::function<void(const char *_msgData, const size_t _size, const MessageInfo &_info)>

◆ RawSubscriptionHandler_M

◆ RawSubscriptionHandlerPtr

◆ SrvAddresses_M

◆ SrvDiscovery

◆ SrvDiscoveryCallback

using SrvDiscoveryCallback = std::function<void(const ServicePublisher &_publisher)>

◆ Timestamp

using Timestamp = std::chrono::steady_clock::time_point

Enumeration Type Documentation

◆ Scope_t

enum class Scope_t
strong
Enumerator
PROCESS 

Topic/service only available to subscribers in the same process as the publisher.

HOST 

Topic/service only available to subscribers in the same machine as the publisher.

ALL 

Topic/service available to any subscriber (default scope).

Function Documentation

◆ _cb()

*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 ReplyT const std::string void(ClassT::*) _cb ( const RequestT &  _req,
ReplyT &  _rep,
bool &  _result 
)

References _cb, _rep, _req, _result, and RequestT.

◆ Advertise() [1/3]

class ignition::transport::Node Advertise ( const std::string _topic,
bool(*)(ReplyT &_rep)  _cb,
const AdvertiseServiceOptions _options = AdvertiseServiceOptions() 
)

◆ Advertise() [2/3]

*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 ReplyT const std::string void(ClassT::*) ClassT const AdvertiseServiceOptions ReplyT bool Advertise ( const std::string _topic,
bool(ClassT::*)(const RequestT &_req, ReplyT &_rep)  _cb,
ClassT *  _obj,
const AdvertiseServiceOptions _options = AdvertiseServiceOptions() 
)

◆ Advertise() [3/3]

*brief Advertise a new service without any output parameter *In this version the callback is a member function *param[in] _topic Topic name associated to the service *param[in] _cb Callback to handle the service request with the *following RequestT bool Advertise ( const std::string _topic,
void(ClassT::*)(const RequestT &_req)  _cb,
ClassT *  _obj,
const AdvertiseServiceOptions _options = AdvertiseServiceOptions() 
)

◆ AdvertisedServices()

std::vector< std::string > AdvertisedServices ( ) const

References Request().

◆ cb()

cb ( _internalRep  ,
_internalResult   
)

◆ determineHost()

std::string determineHost ( )

Determine IP or hostname. Reference: https://github.com/ros/ros_comm/blob/hydro-devel/clients/ roscpp/src/libros/network.cpp.

Returns
The IP or hostname of this host.

◆ determineInterfaces()

std::vector< std::string > determineInterfaces ( )

Determine the list of network interfaces for this machine. Reference: https://github.com/ros/ros_comm/blob/hydro-devel/clients/ roscpp/src/libros/network.cpp.

Returns
The list of network interfaces.

Referenced by Discovery< Pub >::Discovery().

◆ env()

bool env ( const std::string _name,
std::string _value 
)

Find the environment variable '_name' and return its value.

Parameters
[in]_nameName of the environment variable.
[out]_valueValue if the variable was found.
Returns
True if the variable was found or false otherwise.

Referenced by Discovery< Pub >::Discovery().

◆ hostname()

std::string hostname ( )

Determine the computer's hostname.

Returns
The computer's hostname.

◆ hostnameToIp()

int hostnameToIp ( char *  _hostname,
std::string _ip 
)

Determine if an IP is private.

Parameters
[in]_hostnameHostname
[out]_ipIP associated to the input hostname.
Returns
0 when success.

◆ if() [1/7]

if ( !_rep.  ParseFromStringreqHandlerPtr->Response())

References _rep, _result, and std::endl().

◆ if() [2/7]

if ( executed)

◆ if() [3/7]

if ( !reqHandlerPtr->  Result())

References _result.

◆ if() [4/7]

if ( TopicUtils::FullyQualifiedNamethis->Options().Partition(), this->Options().NameSpace(), _topic, fullyQualifiedTopic)

References _topic, and std::endl().

◆ if() [5/7]

References _cb, _req, and repHandler.

◆ if() [6/7]

if ( this->  Shared) ->repliers.FirstHandler(fullyQualifiedTopic, _req.GetTypeName(), _rep.GetTypeName(), repHandler)

References _rep, _req, _result, and repHandler.

◆ if() [7/7]

if ( this->  Shared) ->TopicPublishers(fullyQualifiedTopic, addresses)

References RequestT, and Shared().

◆ isPrivateIP()

bool isPrivateIP ( const char *  _ip)

Determine if an IP is private. Reference: https://github.com/ros/ros_comm/blob/hydro-devel/clients/ roscpp/src/libros/network.cpp.

Parameters
[in]_ipInput IP address.
Returns
true if the IP address is private.

◆ lk()

◆ pollSockets()

bool pollSockets ( const std::vector< int > &  _sockets,
const int  _timeout 
)

◆ Request() [1/4]

return this Request ( _topic  ,
req  ,
_cb   
)

References Request().

Referenced by AdvertisedServices(), Request(), Request(), and Request().

◆ Request() [2/4]

return this Request ( _topic  ,
req  ,
_cb  ,
_obj   
)

◆ Request() [3/4]

return this Request ( _topic  ,
req  ,
_timeout  ,
_rep  ,
_result   
)

References Request().

◆ Request() [4/4]

template<typename RequestT >
bool Request ( const std::string _topic,
const RequestT &  _req 
)

References _req, _topic, and Request().

◆ Request< RequestT, ReplyT >()

return this Request< RequestT, ReplyT > ( _topic  ,
_req  ,
f   
)

◆ ServiceInfo()

bool ServiceInfo ( const std::string _service,
std::vector< ServicePublisher > &  _publishers 
) const

◆ ServiceList()

void ServiceList ( std::vector< std::string > &  _services) const

◆ SetCallback()

reqHandlerPtr SetCallback ( _cb  )

References lk(), and Shared().

◆ Shared()

this Shared ( ) -> requests.AddHandler(fullyQualifiedTopic, this->NodeUuid(), reqHandlerPtr)

Referenced by if(), SetCallback(), and Node::Subscribe().

◆ TopicInfo()

bool TopicInfo ( const std::string _topic,
std::vector< MessagePublisher > &  _publishers 
) const

◆ TopicList()

void TopicList ( std::vector< std::string > &  _topics) const

◆ UnadvertiseSrv()

bool UnadvertiseSrv ( const std::string _topic)

◆ username()

std::string username ( )

Determine your login name.

Returns
Name used to gain access to the computer.

◆ waitForShutdown()

void waitForShutdown ( )

Block the current thread until a SIGINT or SIGTERM is received. Note that this function registers a signal handler. Do not use this function if you want to manage yourself SIGINT/SIGTERM.

Variable Documentation

◆ _cb

*brief Old method for advertising a service This signature is *considered deprecated Please migrate to the callback signature void(ClassT::* _cb)(ReplyT &_rep, bool &_result) ( const RequestT &  _req)

◆ _obj

*brief Old method for advertising a service This signature is *considered deprecated Please migrate to the callback signature void(ClassT::*) ClassT _obj)

◆ _options

*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 & _options
Initial value:
= AdvertiseServiceOptions())
{
std::function<bool(const RequestT &, ignition::msgs::Empty &)> f =
[_cb](const RequestT &_internalReq,
ignition::msgs::Empty &)
{
(*_cb)(_internalReq);
return true;
};
return this->Advertise(_topic, f, _options);
}
* \brief Old method for advertising a service. This signature is
* considered deprecated. Please migrate to the callback signature
* \code{bool (*_cb)(const T1 &_req, T2 &_rep)} for advertising a
* service.
* \param[in] _topic Topic name associated to the service.
* \param[in] _cb Callback to handle the service request with the
* following parameters:
* \param[in] _req Protobuf message containing the request.
* \param[out] _rep Protobuf message containing the response.
* \param[out] _result Service call result.
* \param[in] _options Advertise options.
* \return true when the topic has been successfully advertised or
* false otherwise.
* \sa AdvertiseOptions.
* \deprecated See version where the callback function returns a boolean
public: template<typename RequestT
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:612
*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
*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
[_cb](const ReplyT &_internalRep, const bool _internalResult) {(*_cb)(_internalRep, _internalResult) f
Definition Node.hh:897

Referenced by Advertise(), Node::Advertise(), and Advertise().

◆ _rep

◆ _req

◆ _result

◆ _topic

◆ addresses

SrvAddresses_M addresses

◆ Advertise

*brief Old method for advertising a service This signature is *considered deprecated Please migrate to the callback signature void(ClassT::*) ClassT const AdvertiseServiceOptions ReplyT boo Advertise) (const std::string &_topic, bool(ClassT::*_cb)(ReplyT &_rep), ClassT *_obj, const AdvertiseServiceOptions &_options=AdvertiseServiceOptions()) ( const std::string _topic,
std::function< bool(const RequestT &_req, ReplyT &_rep)> &  _cb,
const AdvertiseServiceOptions _options = AdvertiseServiceOptions() 
)

◆ AdvType

const uint8_t AdvType = 1
static

◆ arguments

* brief Subscribe to a topic registering a callback The callback must* accept a std::string to represent the message and a MessageInfo* which provides metadata about the message* param [in] _topic Name of the topic to subscribe to* param [in] _callback A function pointer or std::function object that* has a void return value and accepts two arguments

◆ ByeType

const uint8_t ByeType = 5
static

◆ code

*brief Old method for advertising a service This signature is *considered deprecated Please migrate to the callback signature * code
Initial value:
{bool (*_cb)(T2 &_rep)} for advertising a service.
* \param[in] _topic Topic name associated to the service.
* \param[in] _cb Callback to handle the service request with the
* following parameters:
* \param[out] _rep Protobuf message containing the response.
* \param[out] _result Service call result.
* \param[in] _options Advertise options.
* \return true when the topic has been successfully advertised or
* false otherwise.
* \deprecated See version where the callback function returns a boolean
public: template<typename ReplyT>
A class for customizing the publication options for a topic or service advertised....
Definition AdvertiseOptions.hh:55
_result
Definition Node.hh:1167
*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 parameters
Definition Node.hh:526
*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
*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 ReplyT const std::string _topic)
Definition Node.hh:558
reqHandlerPtr SetResponse & _rep
Definition Node.hh:1107

◆ constant

*brief Get the list of topics currently advertised in the network *Note that this function can block for some time if the *discovery is in its initialization phase *The value of the heartbeatInterval constant

◆ data

* brief Subscribe to a topic registering a callback The callback must* accept a std::string to represent the message data

◆ else

else
Initial value:
{
if (!this->Shared()->DiscoverService(fullyQualifiedTopic))
{
std::cerr << "Node::Request(): Error discovering a service. "
<< "Did you forget to start the discovery service?"
return false;
}
}
}
return true
T endl(T... args)
this Shared() -> requests.AddHandler(fullyQualifiedTopic, this->NodeUuid(), reqHandlerPtr)

◆ EndConnection

const uint8_t EndConnection = 7
static

◆ HeartbeatType

const uint8_t HeartbeatType = 4
static

◆ kGenericMessageType

const std::string kGenericMessageType = "google.protobuf.Message"

The string type used for generic messages.

Referenced by HandlerStorage< T >::FirstHandler(), and SubscriptionHandler< ProtoMsg >::TypeName().

◆ kUnthrottled

const uint64_t kUnthrottled = std::numeric_limits<uint64_t>::max()
static

Constant used when not interested in throttling.

◆ localResponserFound

localResponserFound
Initial value:
= this->Shared()->repliers.FirstHandler(
fullyQualifiedTopic,
RequestT().GetTypeName(),
ReplyT().GetTypeName(),
repHandler)

◆ ms

* brief Get the list of topics currently advertised in the network* Note that this function can block for some time if the* discovery is in its initialization phase* The value of the heartbeatInterval with a default* value of ms

◆ MsgTypesStr

const std::vector<std::string> MsgTypesStr
static
Initial value:
=
{
"UNINITIALIZED", "ADVERTISE", "SUBSCRIBE", "UNADVERTISE", "HEARTBEAT",
"BYE", "NEW_CONNECTION", "END_CONNECTION"
}

Used for debugging the message type received/send.

◆ NewConnection

const uint8_t NewConnection = 6
static

◆ of

* brief Get the list of topics currently advertised in the network* Note that this function can block for some time if the* discovery is in its initialization phase* The value of the heartbeatInterval with a default* value of

◆ parameters

* brief Advertise a new service without any output parameter* In this version the callback is a member function* param [in] _topic Topic name associated to the service* param [in] _cb Callback to handle the service request with the* following parameters

◆ repHandler

IRepHandlerPtr repHandler

Referenced by if(), and if().

◆ reqHandlerPtr

std::shared_ptr< ReqHandler< RequestT, ReplyT > > reqHandlerPtr ( new ReqHandler< RequestT, ReplyT >  this->NodeUuid())

◆ RequestT

*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 ReplyT const std::string void(ClassT::*) ClassT const AdvertiseServiceOption RequestT)

◆ SubType

const uint8_t SubType = 2
static

◆ true

return true

◆ UnadvType

const uint8_t UnadvType = 3
static

◆ Uninitialized

const uint8_t Uninitialized = 0
static