A collection of PubQueue objects, potentially of different types. This class is the programmer's interface to this queuing system. More...
#include <PubQueue.h>
Public Member Functions | |
template<class T > | |
boost::shared_ptr< PubQueue< T > > | addPub () |
Add a new queue. Call this once for each published topic (or at least each type of publish message). | |
void | notifyServiceThread () |
Wake up the queue serive thread (e.g., after having pushed a message onto one of the queues). | |
PubMultiQueue () | |
void | spin () |
Service all queues indefinitely, waiting on a condition variable in between cycles. | |
void | spinOnce () |
Service each queue one time. | |
void | startServiceThread () |
Start a thread to call spin(). | |
~PubMultiQueue () | |
Private Member Functions | |
template<class T > | |
void | serviceFunc (boost::shared_ptr< PubQueue< T > > pq) |
Service a given queue by popping outgoing message off it and publishing them. | |
Private Attributes | |
boost::condition_variable | service_cond_var_ |
Condition variable used to block and resume service_thread_. | |
boost::mutex | service_cond_var_lock_ |
Mutex to accompany service_cond_var_. | |
std::list< boost::function < void()> > | service_funcs_ |
List of functions to be called to service our queues. | |
boost::mutex | service_funcs_lock_ |
Mutex to lock access to service_funcs_. | |
boost::thread | service_thread_ |
If started, the thread that will call the service functions. |
A collection of PubQueue objects, potentially of different types. This class is the programmer's interface to this queuing system.
Definition at line 97 of file PubQueue.h.
PubMultiQueue::PubMultiQueue | ( | ) | [inline] |
Definition at line 127 of file PubQueue.h.
PubMultiQueue::~PubMultiQueue | ( | ) | [inline] |
Definition at line 128 of file PubQueue.h.
boost::shared_ptr<PubQueue<T> > PubMultiQueue::addPub | ( | ) | [inline] |
Add a new queue. Call this once for each published topic (or at least each type of publish message).
Definition at line 141 of file PubQueue.h.
void PubMultiQueue::notifyServiceThread | ( | ) | [inline] |
Wake up the queue serive thread (e.g., after having pushed a message onto one of the queues).
Definition at line 186 of file PubQueue.h.
void PubMultiQueue::serviceFunc | ( | boost::shared_ptr< PubQueue< T > > | pq | ) | [inline, private] |
Service a given queue by popping outgoing message off it and publishing them.
Definition at line 114 of file PubQueue.h.
void PubMultiQueue::spin | ( | ) | [inline] |
Service all queues indefinitely, waiting on a condition variable in between cycles.
Definition at line 168 of file PubQueue.h.
void PubMultiQueue::spinOnce | ( | ) | [inline] |
Service each queue one time.
Definition at line 155 of file PubQueue.h.
void PubMultiQueue::startServiceThread | ( | ) | [inline] |
Start a thread to call spin().
Definition at line 179 of file PubQueue.h.
boost::condition_variable PubMultiQueue::service_cond_var_ [private] |
Condition variable used to block and resume service_thread_.
Definition at line 107 of file PubQueue.h.
boost::mutex PubMultiQueue::service_cond_var_lock_ [private] |
Mutex to accompany service_cond_var_.
Definition at line 109 of file PubQueue.h.
std::list<boost::function<void()> > PubMultiQueue::service_funcs_ [private] |
List of functions to be called to service our queues.
Definition at line 101 of file PubQueue.h.
boost::mutex PubMultiQueue::service_funcs_lock_ [private] |
Mutex to lock access to service_funcs_.
Definition at line 103 of file PubQueue.h.
boost::thread PubMultiQueue::service_thread_ [private] |
If started, the thread that will call the service functions.
Definition at line 105 of file PubQueue.h.