MongoDB  2.7.0
Public Member Functions | List of all members
mongo::BlockingQueue< T > Class Template Reference

Simple blocking queue with optional max size (by count or custom sizing function). More...

#include <queue.h>

Inheritance diagram for mongo::BlockingQueue< T >:

Public Member Functions

 BlockingQueue (size_t size)
 
 BlockingQueue (size_t size, getSizeFunc f)
 
void push (T const &t)
 
bool empty () const
 
size_t size () const
 The size as measured by the size function. More...
 
size_t maxSize () const
 The max size for this queue.
 
int count () const
 The number/count of items in the queue ( _queue.size() )
 
void clear ()
 
bool tryPop (T &t)
 
blockingPop ()
 
bool blockingPop (T &t, int maxSecondsToWait)
 blocks waiting for an object until maxSecondsToWait passes if got one, return true and set in t otherwise return false and t won't be changed
 
bool blockingPeek (T &t, int maxSecondsToWait)
 
bool peek (T &t)
 

Detailed Description

template<typename T>
class mongo::BlockingQueue< T >

Simple blocking queue with optional max size (by count or custom sizing function).

A custom sizing function can optionally be given. By default the getSize function returns 1 for each item, resulting in size equaling the number of items queued.

Member Function Documentation

template<typename T >
size_t mongo::BlockingQueue< T >::size ( ) const
inline

The size as measured by the size function.

Default to counting each item


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