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< MessagePublisher > | Convert (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::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. | |
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< ISubscriptionHandler > | normal |
Normal local subscriptions. | |
HandlerStorage< RawSubscriptionHandler > | raw |
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] _addr The pub/sub address. [in] _pUuid The 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] _fullyQualifiedTopic Fully-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] _fullyQualifiedTopic Fully-qualified topic name [in] _msgType Name 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] _fullyQualifiedTopic Fully-qualified topic name that the subscribers must be listening to. [in] _msgTypeName Name 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] _fullyQualifiedTopic The fully-qualified name of the topic whose subscribers should be removed. [in] _nUuid The UUID of the node whose subscribers should be removed.
- Returns
- True if at least one subscriber was removed.
Member Data Documentation
◆ normal
HandlerStorage<ISubscriptionHandler> 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: