Public Types | Public Member Functions | Private Attributes | List of all members
PubQueue< T > Class Template Reference

A queue of outgoing messages. Instead of calling publish() directly, you can push() messages here to defer ROS serialization and locking. Templated on a ROS message type. More...

#include <PubQueue.h>

Public Types

typedef boost::shared_ptr< PubQueue< T > > Ptr
 
typedef boost::shared_ptr< std::deque< boost::shared_ptr< PubMessagePair< T > > > > QueuePtr
 

Public Member Functions

void pop (std::vector< boost::shared_ptr< PubMessagePair< T > > > &els)
 Pop all waiting messages off the queue. More...
 
 PubQueue (QueuePtr queue, boost::shared_ptr< boost::mutex > queue_lock, boost::function< void()> notify_func)
 
void push (T &msg, ros::Publisher &pub)
 Push a new message onto the queue. More...
 
 ~PubQueue ()
 

Private Attributes

boost::function< void()> notify_func_
 Function that will be called when a new message is pushed on. More...
 
QueuePtr queue_
 Our queue of outgoing messages. More...
 
boost::shared_ptr< boost::mutex > queue_lock_
 Mutex to control access to the queue. More...
 

Detailed Description

template<class T>
class PubQueue< T >

A queue of outgoing messages. Instead of calling publish() directly, you can push() messages here to defer ROS serialization and locking. Templated on a ROS message type.

Definition at line 48 of file PubQueue.h.

Member Typedef Documentation

template<class T>
typedef boost::shared_ptr<PubQueue<T> > PubQueue< T >::Ptr

Definition at line 53 of file PubQueue.h.

template<class T>
typedef boost::shared_ptr<std::deque<boost::shared_ptr< PubMessagePair<T> > > > PubQueue< T >::QueuePtr

Definition at line 52 of file PubQueue.h.

Constructor & Destructor Documentation

template<class T>
PubQueue< T >::PubQueue ( QueuePtr  queue,
boost::shared_ptr< boost::mutex >  queue_lock,
boost::function< void()>  notify_func 
)
inline

Definition at line 64 of file PubQueue.h.

template<class T>
PubQueue< T >::~PubQueue ( )
inline

Definition at line 68 of file PubQueue.h.

Member Function Documentation

template<class T>
void PubQueue< T >::pop ( std::vector< boost::shared_ptr< PubMessagePair< T > > > &  els)
inline

Pop all waiting messages off the queue.

Parameters
[out]elsPlace to store the popped messages

Definition at line 83 of file PubQueue.h.

template<class T>
void PubQueue< T >::push ( T &  msg,
ros::Publisher pub 
)
inline

Push a new message onto the queue.

Parameters
[in]msgThe outgoing message
[in]pubThe ROS publisher to use to publish the message

Definition at line 73 of file PubQueue.h.

Member Data Documentation

template<class T>
boost::function<void()> PubQueue< T >::notify_func_
private

Function that will be called when a new message is pushed on.

Definition at line 61 of file PubQueue.h.

template<class T>
QueuePtr PubQueue< T >::queue_
private

Our queue of outgoing messages.

Definition at line 57 of file PubQueue.h.

template<class T>
boost::shared_ptr<boost::mutex> PubQueue< T >::queue_lock_
private

Mutex to control access to the queue.

Definition at line 59 of file PubQueue.h.


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


gazebo_plugins
Author(s): John Hsu
autogenerated on Tue Apr 6 2021 02:19:40