HOG2
Public Member Functions | Private Attributes | List of all members
SharedQueue< T > Class Template Reference

#include <SharedQueue.h>

Public Member Functions

 SharedQueue (int maxCapacity=-1)
 
 ~SharedQueue ()
 
bool IsEmpty () const
 
void Add (T value)
 
bool Remove (T &item)
 
void WaitAdd (const T &value)
 
void WaitRemove (T &item)
 
void Print ()
 
size_t size ()
 

Private Attributes

std::deque< T > queue
 
int maxCapacity
 
std::mutex lock
 
std::condition_variable notFull
 
std::condition_variable notEmpty
 

Detailed Description

template<typename T>
class SharedQueue< T >

Definition at line 24 of file SharedQueue.h.

Constructor & Destructor Documentation

◆ SharedQueue()

template<typename T >
SharedQueue< T >::SharedQueue ( int  maxCapacity = -1)

Definition at line 45 of file SharedQueue.h.

◆ ~SharedQueue()

template<typename T >
SharedQueue< T >::~SharedQueue

Definition at line 51 of file SharedQueue.h.

Member Function Documentation

◆ Add()

template<typename T >
void SharedQueue< T >::Add ( value)

◆ IsEmpty()

template<typename T >
bool SharedQueue< T >::IsEmpty

Definition at line 56 of file SharedQueue.h.

◆ Print()

template<typename T >
void SharedQueue< T >::Print

Definition at line 128 of file SharedQueue.h.

◆ Remove()

template<typename T >
bool SharedQueue< T >::Remove ( T &  item)

◆ size()

template<typename T >
size_t SharedQueue< T >::size

Definition at line 65 of file SharedQueue.h.

◆ WaitAdd()

template<typename T >
void SharedQueue< T >::WaitAdd ( const T &  value)

◆ WaitRemove()

template<typename T >
void SharedQueue< T >::WaitRemove ( T &  item)

Definition at line 115 of file SharedQueue.h.

Referenced by VoxelUtils::ThreadedWorker().

Member Data Documentation

◆ lock

template<typename T >
std::mutex SharedQueue< T >::lock
mutableprivate

Definition at line 39 of file SharedQueue.h.

◆ maxCapacity

template<typename T >
int SharedQueue< T >::maxCapacity
private

Definition at line 38 of file SharedQueue.h.

◆ notEmpty

template<typename T >
std::condition_variable SharedQueue< T >::notEmpty
mutableprivate

Definition at line 41 of file SharedQueue.h.

◆ notFull

template<typename T >
std::condition_variable SharedQueue< T >::notFull
mutableprivate

Definition at line 40 of file SharedQueue.h.

◆ queue

template<typename T >
std::deque<T> SharedQueue< T >::queue
private

Definition at line 37 of file SharedQueue.h.


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