Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
roswrap::Subscriber Class Reference

Manages an subscription callback on a specific topic. More...

#include <subscriber.h>

Classes

class  Impl
 

Public Member Functions

uint32_t getNumPublishers () const
 Returns the number of publishers this subscriber is connected to. More...
 
std::string getTopic () const
 
 operator void * () const
 
bool operator!= (const Subscriber &rhs) const
 
bool operator< (const Subscriber &rhs) const
 
bool operator== (const Subscriber &rhs) const
 
void shutdown ()
 Unsubscribe the callback associated with this Subscriber. More...
 
 Subscriber ()
 
 Subscriber (const Subscriber &rhs)
 
 ~Subscriber ()
 

Private Types

typedef std::shared_ptr< ImplImplPtr
 
typedef std::weak_ptr< ImplImplWPtr
 

Private Member Functions

 Subscriber (const std::string &topic, const NodeHandle &node_handle, const SubscriptionCallbackHelperPtr &helper)
 

Private Attributes

ImplPtr impl_
 

Friends

class NodeHandle
 
class NodeHandleBackingCollection
 

Detailed Description

Manages an subscription callback on a specific topic.

A Subscriber should always be created through a call to NodeHandle::subscribe(), or copied from one that was. Once all copies of a specific Subscriber go out of scope, the subscription callback associated with that handle will stop being called. Once all Subscriber for a given topic go out of scope the topic will be unsubscribed.

Definition at line 47 of file subscriber.h.

Member Typedef Documentation

◆ ImplPtr

typedef std::shared_ptr<Impl> roswrap::Subscriber::ImplPtr
private

Definition at line 108 of file subscriber.h.

◆ ImplWPtr

typedef std::weak_ptr<Impl> roswrap::Subscriber::ImplWPtr
private

Definition at line 109 of file subscriber.h.

Constructor & Destructor Documentation

◆ Subscriber() [1/3]

roswrap::Subscriber::Subscriber ( )
inline

Definition at line 50 of file subscriber.h.

◆ Subscriber() [2/3]

roswrap::Subscriber::Subscriber ( const Subscriber rhs)

◆ ~Subscriber()

roswrap::Subscriber::~Subscriber ( )

◆ Subscriber() [3/3]

roswrap::Subscriber::Subscriber ( const std::string &  topic,
const NodeHandle node_handle,
const SubscriptionCallbackHelperPtr helper 
)
private

Member Function Documentation

◆ getNumPublishers()

uint32_t roswrap::Subscriber::getNumPublishers ( ) const

Returns the number of publishers this subscriber is connected to.

◆ getTopic()

std::string roswrap::Subscriber::getTopic ( ) const

◆ operator void *()

roswrap::Subscriber::operator void * ( ) const
inline

Definition at line 72 of file subscriber.h.

◆ operator!=()

bool roswrap::Subscriber::operator!= ( const Subscriber rhs) const
inline

Definition at line 84 of file subscriber.h.

◆ operator<()

bool roswrap::Subscriber::operator< ( const Subscriber rhs) const
inline

Definition at line 74 of file subscriber.h.

◆ operator==()

bool roswrap::Subscriber::operator== ( const Subscriber rhs) const
inline

Definition at line 79 of file subscriber.h.

◆ shutdown()

ROSCPP_DECL void roswrap::Subscriber::shutdown ( )

Unsubscribe the callback associated with this Subscriber.

This method usually does not need to be explicitly called, as automatic shutdown happens when all copies of this Subscriber go out of scope

This method overrides the automatic reference counted unsubscribe, and immediately unsubscribes the callback associated with this Subscriber

Definition at line 111 of file rossimu.cpp.

Friends And Related Function Documentation

◆ NodeHandle

friend class NodeHandle
friend

Definition at line 113 of file subscriber.h.

◆ NodeHandleBackingCollection

friend class NodeHandleBackingCollection
friend

Definition at line 114 of file subscriber.h.

Member Data Documentation

◆ impl_

ImplPtr roswrap::Subscriber::impl_
private

Definition at line 111 of file subscriber.h.


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


sick_scan_xd
Author(s): Michael Lehning , Jochen Sprickerhof , Martin Günther
autogenerated on Fri Oct 25 2024 02:47:15