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... | |
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.
typedef boost::shared_ptr<PubQueue<T> > PubQueue< T >::Ptr |
Definition at line 53 of file PubQueue.h.
typedef boost::shared_ptr<std::deque<boost::shared_ptr< PubMessagePair<T> > > > PubQueue< T >::QueuePtr |
Definition at line 52 of file PubQueue.h.
|
inline |
Definition at line 64 of file PubQueue.h.
Definition at line 68 of file PubQueue.h.
|
inline |
Pop all waiting messages off the queue.
[out] | els | Place to store the popped messages |
Definition at line 83 of file PubQueue.h.
|
inline |
Push a new message onto the queue.
[in] | msg | The outgoing message |
[in] | pub | The ROS publisher to use to publish the message |
Definition at line 73 of file PubQueue.h.
|
private |
Function that will be called when a new message is pushed on.
Definition at line 61 of file PubQueue.h.
Our queue of outgoing messages.
Definition at line 57 of file PubQueue.h.
|
private |
Mutex to control access to the queue.
Definition at line 59 of file PubQueue.h.