Conquer Space 0.0.0
A space themed grand strategy game set in the near future, with realistic orbital mechanics, and an emphasis on economics and politics.
Public Member Functions | Private Member Functions | Private Attributes | List of all members
cqsp::asset::ThreadsafeQueue< T > Class Template Reference

#include <assetmanager.h>

Public Member Functions

 ThreadsafeQueue ()=default
 
 ThreadsafeQueue (const ThreadsafeQueue< T > &)=delete
 
ThreadsafeQueueoperator= (const ThreadsafeQueue< T > &)=delete
 
 ThreadsafeQueue (ThreadsafeQueue< T > &&other)
 
virtual ~ThreadsafeQueue ()
 
unsigned long size () const
 
std::optional< T > pop ()
 
void push (const T &item)
 

Private Member Functions

bool empty () const
 

Private Attributes

std::queue< T > queue_
 
std::mutex mutex_
 

Detailed Description

template<typename T>
class cqsp::asset::ThreadsafeQueue< T >

Queue to hold the asset prototypes.

Constructor & Destructor Documentation

◆ ThreadsafeQueue() [1/3]

template<typename T >
cqsp::asset::ThreadsafeQueue< T >::ThreadsafeQueue ( )
default

◆ ThreadsafeQueue() [2/3]

template<typename T >
cqsp::asset::ThreadsafeQueue< T >::ThreadsafeQueue ( const ThreadsafeQueue< T > &  )
delete

◆ ThreadsafeQueue() [3/3]

template<typename T >
cqsp::asset::ThreadsafeQueue< T >::ThreadsafeQueue ( ThreadsafeQueue< T > &&  other)
inline

◆ ~ThreadsafeQueue()

template<typename T >
virtual cqsp::asset::ThreadsafeQueue< T >::~ThreadsafeQueue ( )
inlinevirtual

Member Function Documentation

◆ empty()

template<typename T >
bool cqsp::asset::ThreadsafeQueue< T >::empty ( ) const
inlineprivate

◆ operator=()

template<typename T >
ThreadsafeQueue & cqsp::asset::ThreadsafeQueue< T >::operator= ( const ThreadsafeQueue< T > &  )
delete

◆ pop()

template<typename T >
std::optional< T > cqsp::asset::ThreadsafeQueue< T >::pop ( )
inline

◆ push()

template<typename T >
void cqsp::asset::ThreadsafeQueue< T >::push ( const T &  item)
inline

◆ size()

template<typename T >
unsigned long cqsp::asset::ThreadsafeQueue< T >::size ( ) const
inline

Member Data Documentation

◆ mutex_

template<typename T >
std::mutex cqsp::asset::ThreadsafeQueue< T >::mutex_
mutableprivate

◆ queue_

template<typename T >
std::queue<T> cqsp::asset::ThreadsafeQueue< T >::queue_
private

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