Public Types | Public Member Functions | Private Attributes
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>

List of all members.

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.
 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.
 ~PubQueue ()

Private Attributes

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

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 49 of file PubQueue.h.


Member Typedef Documentation

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

Definition at line 54 of file PubQueue.h.

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

Definition at line 53 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 65 of file PubQueue.h.

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

Definition at line 69 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 84 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 74 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 62 of file PubQueue.h.

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

Our queue of outgoing messages.

Definition at line 58 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 60 of file PubQueue.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends Defines


hrpsys_gazebo_general
Author(s): Yohei Kakiuchi
autogenerated on Tue Jul 23 2013 11:49:13