AudiClean
Public Member Functions | List of all members
BlockingQueue< T > Class Template Reference

BlockingQueue Class. More...

#include <BlockingQueue.h>

Inheritance diagram for BlockingQueue< T >:
Inheritance graph
Collaboration diagram for BlockingQueue< T >:
Collaboration graph

Public Member Functions

 BlockingQueue (int maxSize=1)
 
void Push (T toPush)
 
Pop ()
 
bool IsEmpty ()
 
int Size ()
 
bool Full ()
 

Detailed Description

template<typename T>
class BlockingQueue< T >

BlockingQueue Class.

Class to wrap around std::deque and block thread execution when no data is available at the output or when the queue is full.

Template Parameters
TType of elements in the queue

Constructor & Destructor Documentation

◆ BlockingQueue()

template<typename T >
BlockingQueue< T >::BlockingQueue ( int  _maxSize = 1)

constructor for BlockingQueue, maxSize may be set

Template Parameters
T
Parameters
_maxSizemaximum size of the blocking queue to set

Member Function Documentation

◆ Full()

template<typename T >
bool BlockingQueue< T >::Full

checks if the queue is full

Template Parameters
T
Returns
true if full; false otherwise

◆ IsEmpty()

template<typename T >
bool BlockingQueue< T >::IsEmpty
Template Parameters
T
Returns
true if internal queue empty, false otherwise

◆ Pop()

template<typename T >
T BlockingQueue< T >::Pop

Pop method, uses mutex lock to sleep the current thread until data are available on the queue. This may be used to synchonise and schedule threads.

Template Parameters
T
Returns
Element on deque back

◆ Push()

template<typename T >
void BlockingQueue< T >::Push ( toPush)

adds element to the queue.

Template Parameters
T
Parameters
toPush

◆ Size()

template<typename T >
int BlockingQueue< T >::Size

Gets the current length of elements in the queue.

Template Parameters
T
Returns
size of internal deque

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