mrs_lib
Various reusable classes, functions and utilities for use in MRS projects
mrs_lib::PublisherHandler< TopicType > Class Template Reference

user wrapper of the publisher handler implementation More...

#include <publisher_handler.h>

Public Member Functions

 PublisherHandler (void)
 generic constructor
 
 ~PublisherHandler (void)
 generic destructor
 
PublisherHandleroperator= (const PublisherHandler &other)
 operator= More...
 
 PublisherHandler (const PublisherHandler &other)
 copy constructor More...
 
 PublisherHandler (ros::NodeHandle &nh, const std::string &address, const unsigned int &buffer_size=1, const bool &latch=false, const double &rate=0)
 constructor More...
 
void publish (const TopicType &msg)
 publish message More...
 
void publish (const boost::shared_ptr< TopicType > &msg)
 publish message, boost ptr overload More...
 
void publish (const boost::shared_ptr< TopicType const > &msg)
 publish message, boost const ptr overload More...
 
unsigned int getNumSubscribers (void)
 get number of subscribers More...
 

Detailed Description

template<class TopicType>
class mrs_lib::PublisherHandler< TopicType >

user wrapper of the publisher handler implementation

Constructor & Destructor Documentation

◆ PublisherHandler() [1/2]

template<class TopicType >
mrs_lib::PublisherHandler< TopicType >::PublisherHandler ( const PublisherHandler< TopicType > &  other)

copy constructor

Parameters
other

◆ PublisherHandler() [2/2]

template<class TopicType >
mrs_lib::PublisherHandler< TopicType >::PublisherHandler ( ros::NodeHandle &  nh,
const std::string &  address,
const unsigned int &  buffer_size = 1,
const bool &  latch = false,
const double &  rate = 0 
)

constructor

Parameters
nhROS node handler
addresstopic address
buffer_sizebuffer size
latchlatching

Member Function Documentation

◆ getNumSubscribers()

template<class TopicType >
unsigned int mrs_lib::PublisherHandler< TopicType >::getNumSubscribers ( void  )

get number of subscribers

Returns
the number of subscribers

◆ operator=()

template<class TopicType >
PublisherHandler< TopicType > & mrs_lib::PublisherHandler< TopicType >::operator= ( const PublisherHandler< TopicType > &  other)

operator=

Parameters
other
Returns

◆ publish() [1/3]

template<class TopicType >
void mrs_lib::PublisherHandler< TopicType >::publish ( const boost::shared_ptr< TopicType > &  msg)

publish message, boost ptr overload

Parameters
msg

◆ publish() [2/3]

template<class TopicType >
void mrs_lib::PublisherHandler< TopicType >::publish ( const boost::shared_ptr< TopicType const > &  msg)

publish message, boost const ptr overload

Parameters
msg

◆ publish() [3/3]

template<class TopicType >
void mrs_lib::PublisherHandler< TopicType >::publish ( const TopicType &  msg)

publish message

Parameters
msg

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