Public Member Functions | Private Attributes

nc::blocking_queue< T > Class Template Reference

#include <acsncBlockingQueue.h>

List of all members.

Public Member Functions

 blocking_queue ()
 ~blocking_queue ()
void push (event_info< T > &data)
event_info< T > pop ()
void pop_no_block ()
unsigned int size ()
void unblock ()

Private Attributes

std::queue< event_info< T > > buffer
pthread_mutex_t mutex
pthread_cond_t cond

template<class T>
class nc::blocking_queue< T >


Constructor & Destructor Documentation

template<class T>
nc::blocking_queue< T >::blocking_queue (  ) 
template<class T>
nc::blocking_queue< T >::~blocking_queue (  ) 

Member Function Documentation

template<class T>
event_info<T> nc::blocking_queue< T >::pop (  ) 

Return a event_info item from buffer, remove this item from buffer. This methods blocks if the queue is empty.

Exceptions:
interrupted_blocking_queue if the queue was interrupted
See also:
event_info
template<class T>
void nc::blocking_queue< T >::pop_no_block (  ) 

Pop one event from buffer without returning it. This method does not block of the size of the queue is 0 (zero)

template<class T>
void nc::blocking_queue< T >::push ( event_info< T > &  data  ) 
template<class T>
unsigned int nc::blocking_queue< T >::size (  ) 

Returns the current size of the queue. This method does not block to get the current size of the buffer

template<class T>
void nc::blocking_queue< T >::unblock (  ) 

Interrupts the waiting of the threads blocked in pop method.

See also:
blocking_queue::pop()

Member Data Documentation

template<class T>
std::queue<event_info<T> > nc::blocking_queue< T >::buffer [private]
template<class T>
pthread_cond_t nc::blocking_queue< T >::cond [private]
template<class T>
pthread_mutex_t nc::blocking_queue< T >::mutex [private]

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