Workspace 6.21.5
Public Types | Public Member Functions | List of all members
ThreadSafeQueue< T > Class Template Reference

A queue that operates in a threadsafe manner, queueing and dequeing appropriately regardless of the calling thread. More...

#include <Rendering/OpenGL/threadsafequeue.h>

Inheritance diagram for ThreadSafeQueue< T >:
[legend]

Public Types

using size_type = typename ItemQueue::size_type
 
using value_type = T
 

Public Member Functions

 ~ThreadSafeQueue ()
 
void clear ()
 
std::unique_ptr< T > dequeue ()
 
bool empty () const
 
void enqueue (std::unique_ptr< T > t)
 
bool getStopWaiting () const
 
void setStopWaiting (bool b)
 
size_type size () const
 
- Public Member Functions inherited from BasicTextLogger
 BasicTextLogger ()
 
virtual ~BasicTextLogger ()
 
void logLine (const Application::LogManager::MessageCategory &category, const QString &msg) const
 
void logLine (const QString &msg) const
 
void logText (const Application::LogManager::MessageCategory &category, const QString &msg) const
 
void logText (const QString &msg) const
 

Detailed Description

template<typename T>
class CSIRO::Rendering::ThreadSafeQueue< T >

Internally, this queue uses std::condition_variable to sleep the thread when the queue is empty so there is no busy waiting.

Member Typedef Documentation

◆ size_type

using size_type = typename ItemQueue::size_type

◆ value_type

using value_type = T

Constructor & Destructor Documentation

◆ ~ThreadSafeQueue()

~ThreadSafeQueue ( )
inline

Member Function Documentation

◆ clear()

void clear ( )
inline

◆ dequeue()

std::unique_ptr< T > dequeue ( )
inline

◆ empty()

bool empty ( ) const
inline

◆ enqueue()

void enqueue ( std::unique_ptr< T >  t)
inline

◆ getStopWaiting()

bool getStopWaiting ( ) const
inline

◆ setStopWaiting()

void setStopWaiting ( bool  b)
inline

◆ size()

size_type size ( ) const
inline