Gazebo Transport

API Reference

8.5.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

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. More...
 
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. More...
 
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. More...
 
bool RemoveHandlersForNode (const std::string &_fullyQualifiedTopic, const std::string &_nUuid)
 Remove the handlers for the given topic name that belong to a specific node. More...
 

Public Attributes

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

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

◆ 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: