Gazebo Transport

API Reference

14.0.0
SubscriptionHandlerBase Class Referenceabstract

SubscriptionHandlerBase contains functions and data which are common to all SubscriptionHandler types. More...

#include <SubscriptionHandler.hh>

Public Member Functions

 SubscriptionHandlerBase (const std::string &_nUuid, const SubscribeOptions &_opts=SubscribeOptions())
 Constructor.
 
virtual ~SubscriptionHandlerBase ()=default
 Destructor.
 
std::string HandlerUuid () const
 Get the unique UUID of this handler.
 
bool IgnoreLocalMessages () const
 Return whether local messages are ignored or not.
 
std::string NodeUuid () const
 Get the node UUID.
 
virtual std::string TypeName ()=0
 Get the type of the messages from which this subscriber handler is subscribed.
 

Protected Member Functions

bool UpdateThrottling ()
 Check if message subscription is throttled. If so, verify whether the callback should be executed or not.
 

Protected Attributes

std::string hUuid
 Unique handler's UUID.
 
Timestamp lastCbTimestamp
 Timestamp of the last callback executed.
 
SubscribeOptions opts
 Subscribe options.
 
double periodNs
 If throttling is enabled, the minimum period for receiving a message in nanoseconds.
 

Detailed Description

SubscriptionHandlerBase contains functions and data which are common to all SubscriptionHandler types.

Constructor & Destructor Documentation

◆ SubscriptionHandlerBase()

SubscriptionHandlerBase ( const std::string _nUuid,
const SubscribeOptions _opts = SubscribeOptions() 
)
explicit

Constructor.

Parameters
[in]_nUuidUUID of the node registering the handler.
[in]_optsSubscription options.

◆ ~SubscriptionHandlerBase()

virtual ~SubscriptionHandlerBase ( )
virtualdefault

Destructor.

Member Function Documentation

◆ HandlerUuid()

std::string HandlerUuid ( ) const

Get the unique UUID of this handler.

Returns
A string representation of the handler UUID.

◆ IgnoreLocalMessages()

bool IgnoreLocalMessages ( ) const

Return whether local messages are ignored or not.

Returns
True when local messages are ignored or false otherwise.

◆ NodeUuid()

std::string NodeUuid ( ) const

Get the node UUID.

Returns
The string representation of the node UUID.

◆ TypeName()

virtual std::string TypeName ( )
pure virtual

Get the type of the messages from which this subscriber handler is subscribed.

Returns
String representation of the message type.

Implemented in SubscriptionHandler< T >, SubscriptionHandler< ProtoMsg >, and RawSubscriptionHandler.

◆ UpdateThrottling()

bool UpdateThrottling ( )
protected

Check if message subscription is throttled. If so, verify whether the callback should be executed or not.

Returns
true if the callback should be executed or false otherwise.

Referenced by SubscriptionHandler< T >::RunLocalCallback(), and SubscriptionHandler< ProtoMsg >::RunLocalCallback().

Member Data Documentation

◆ hUuid

std::string hUuid
protected

Unique handler's UUID.

◆ lastCbTimestamp

Timestamp lastCbTimestamp
protected

Timestamp of the last callback executed.

◆ opts

SubscribeOptions opts
protected

Subscribe options.

◆ periodNs

double periodNs
protected

If throttling is enabled, the minimum period for receiving a message in nanoseconds.


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