Gazebo Transport

API Reference

15.0.0~pre1
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 &_pUuid, const std::string &_nUuid, const SubscribeOptions &_opts=SubscribeOptions())
 Constructor.
 
virtual ~SubscriptionHandlerBase ()
 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.
 
std::string ProcUuid () const
 Get the process 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::unique_ptr< SubscriptionHandlerBasePrivate > dataPtr
 Private data.
 
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 _pUuid,
const std::string _nUuid,
const SubscribeOptions _opts = SubscribeOptions() 
)
explicit

Constructor.

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

◆ ~SubscriptionHandlerBase()

virtual ~SubscriptionHandlerBase ( )
virtual

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.

◆ ProcUuid()

std::string ProcUuid ( ) const

Get the process UUID.

Returns
The string representation of the process 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

◆ dataPtr

std::unique_ptr<SubscriptionHandlerBasePrivate> dataPtr
protected

Private data.

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