Gazebo Transport

API Reference

13.4.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. More...
 
virtual ~SubscriptionHandlerBase ()=default
 Destructor. More...
 
std::string HandlerUuid () const
 Get the unique UUID of this handler. More...
 
bool IgnoreLocalMessages () const
 Return whether local messages are ignored or not. More...
 
std::string NodeUuid () const
 Get the node UUID. More...
 
virtual std::string TypeName ()=0
 Get the type of the messages from which this subscriber handler is subscribed. More...
 

Protected Member Functions

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

Protected Attributes

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

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 RawSubscriptionHandler, SubscriptionHandler< ProtoMsg >, and SubscriptionHandler< T >.

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