qpid::cluster::PollableQueue< T > Class Template Reference

A queue that can be polled by sys::Poller. More...

#include <PollableQueue.h>

Inheritance diagram for qpid::cluster::PollableQueue< T >:
[legend]
Collaboration diagram for qpid::cluster::PollableQueue< T >:
[legend]

List of all members.

Public Types

typedef Queue::iterator iterator
typedef boost::function< void(const
iterator &, const iterator &)> 
Callback
 Callback to process a range of items.

Public Member Functions

 PollableQueue (const Callback &cb)
 When the queue is selected by the poller, values are passed to callback cb.
void push (const T &t)
 Push a value onto the queue.
void start (const boost::shared_ptr< sys::Poller > &poller)
 Start polling.
void stop ()
 Stop polling.


Detailed Description

template<class T>
class qpid::cluster::PollableQueue< T >

A queue that can be polled by sys::Poller.

Any thread can push to the queue, on wakeup the poller thread processes all items on the queue by passing them to a callback in a batch.

Definition at line 47 of file PollableQueue.h.


Member Typedef Documentation

template<class T>
typedef boost::function<void (const iterator&, const iterator&)> qpid::cluster::PollableQueue< T >::Callback

Callback to process a range of items.

Definition at line 54 of file PollableQueue.h.


Constructor & Destructor Documentation

template<class T>
qpid::cluster::PollableQueue< T >::PollableQueue ( const Callback cb  )  [inline, explicit]

When the queue is selected by the poller, values are passed to callback cb.

Definition at line 82 of file PollableQueue.h.


Member Function Documentation

template<class T>
void qpid::cluster::PollableQueue< T >::push ( const T &  t  )  [inline]

Push a value onto the queue.

Thread safe

Definition at line 60 of file PollableQueue.h.

template<class T>
void qpid::cluster::PollableQueue< T >::start ( const boost::shared_ptr< sys::Poller > &  poller  )  [inline]

Start polling.

Definition at line 63 of file PollableQueue.h.

template<class T>
void qpid::cluster::PollableQueue< T >::stop (  )  [inline]

Stop polling.

Definition at line 66 of file PollableQueue.h.


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

Generated on Fri Sep 5 00:23:52 2008 for Qpid by  doxygen 1.5.6