Gazebo Transport

API Reference

14.0.0
NodeShared::HandlerWrapper Struct Reference

This struct wraps up the two different types of subscription handlers: normal (deserialized) and raw (serialized). This wrapper keeps the two sets of subscription handlers coordinated while allowing them to act independently when necessary. More...

#include <NodeShared.hh>

Public Member Functions

std::vector< MessagePublisherConvert (const std::string &_addr, const std::string &_pUuid)
 Convert all the HandlerStorages into a vector of publishers.
 
bool HasSubscriber (const std::string &_fullyQualifiedTopic) const
 Returns true if this wrapper contains any subscriber that matches the given fully-qualified topic name. The message type name of the subscriber is irrelevant.
 
bool HasSubscriber (const std::string &_fullyQualifiedTopic, const std::string &_msgType) const
 Returns true if this wrapper contains any subscriber that matches the given topic name and message type name.
 
std::vector< std::stringNodeUuids (const std::string &_fullyQualifiedTopic, const std::string &_msgTypeName) const
 Get a set of node UUIDs for subscribers in this wrapper that match the topic and message type criteria.
 
bool RemoveHandlersForNode (const std::string &_fullyQualifiedTopic, const std::string &_nUuid)
 Remove the handlers for the given topic name that belong to a specific node.
 

Public Attributes

HandlerStorage< ISubscriptionHandlernormal
 Normal local subscriptions.
 
HandlerStorage< RawSubscriptionHandlerraw
 Raw local subscriptions. Keeping these separate from localSubscriptions allows us to avoid an unnecessary deserialization followed by an immediate reserialization.
 

Detailed Description

This struct wraps up the two different types of subscription handlers: normal (deserialized) and raw (serialized). This wrapper keeps the two sets of subscription handlers coordinated while allowing them to act independently when necessary.

Member Function Documentation

◆ Convert()

std::vector< MessagePublisher > Convert ( const std::string _addr,
const std::string _pUuid 
)

Convert all the HandlerStorages into a vector of publishers.

Parameters
[in]_addrThe pub/sub address.
[in]_pUuidThe process UUID.
Returns
The vector of message publishers.

◆ HasSubscriber() [1/2]

bool HasSubscriber ( const std::string _fullyQualifiedTopic) const

Returns true if this wrapper contains any subscriber that matches the given fully-qualified topic name. The message type name of the subscriber is irrelevant.

Parameters
[in]_fullyQualifiedTopicFully-qualified topic name
Returns
True if this contains a matching subscriber, otherwise false

◆ HasSubscriber() [2/2]

bool HasSubscriber ( const std::string _fullyQualifiedTopic,
const std::string _msgType 
) const

Returns true if this wrapper contains any subscriber that matches the given topic name and message type name.

Parameters
[in]_fullyQualifiedTopicFully-qualified topic name
[in]_msgTypeName of message type
Returns
True if this contains a matching subscriber, otherwise false
See also
TopicUtils::FullyQualifiedName

◆ NodeUuids()

std::vector< std::string > NodeUuids ( const std::string _fullyQualifiedTopic,
const std::string _msgTypeName 
) const

Get a set of node UUIDs for subscribers in this wrapper that match the topic and message type criteria.

Parameters
[in]_fullyQualifiedTopicFully-qualified topic name that the subscribers must be listening to.
[in]_msgTypeNameName of the message type that the subscribers must be listening for.
Returns
The node UUIDs of all subscribers that match the criteria

◆ RemoveHandlersForNode()

bool RemoveHandlersForNode ( const std::string _fullyQualifiedTopic,
const std::string _nUuid 
)

Remove the handlers for the given topic name that belong to a specific node.

Parameters
[in]_fullyQualifiedTopicThe fully-qualified name of the topic whose subscribers should be removed.
[in]_nUuidThe UUID of the node whose subscribers should be removed.
Returns
True if at least one subscriber was removed.

Member Data Documentation

◆ normal

Normal local subscriptions.

◆ raw

Raw local subscriptions. Keeping these separate from localSubscriptions allows us to avoid an unnecessary deserialization followed by an immediate reserialization.


The documentation for this struct was generated from the following file: