thread-pool
Loading...
Searching...
No Matches
dp::thread_safe_queue< T, Lock > Class Template Reference

#include <thread_safe_queue.h>

Public Types

using value_type = T
 
using size_type = typename std::deque< T >::size_type
 

Public Member Functions

 thread_safe_queue ()=default
 
void push_back (T &&value)
 
void push_front (T &&value)
 
bool empty () const
 
std::optional< T > pop_front ()
 
std::optional< T > pop_back ()
 
std::optional< T > steal ()
 
void rotate_to_front (const T &item)
 
std::optional< T > copy_front_and_rotate_to_back ()
 

Member Typedef Documentation

◆ size_type

template<typename T , typename Lock = std::mutex>
using dp::thread_safe_queue< T, Lock >::size_type = typename std::deque<T>::size_type

◆ value_type

template<typename T , typename Lock = std::mutex>
using dp::thread_safe_queue< T, Lock >::value_type = T

Constructor & Destructor Documentation

◆ thread_safe_queue()

template<typename T , typename Lock = std::mutex>
dp::thread_safe_queue< T, Lock >::thread_safe_queue ( )
default

Member Function Documentation

◆ copy_front_and_rotate_to_back()

template<typename T , typename Lock = std::mutex>
std::optional< T > dp::thread_safe_queue< T, Lock >::copy_front_and_rotate_to_back ( )
inline

◆ empty()

template<typename T , typename Lock = std::mutex>
bool dp::thread_safe_queue< T, Lock >::empty ( ) const
inline

◆ pop_back()

template<typename T , typename Lock = std::mutex>
std::optional< T > dp::thread_safe_queue< T, Lock >::pop_back ( )
inline

◆ pop_front()

template<typename T , typename Lock = std::mutex>
std::optional< T > dp::thread_safe_queue< T, Lock >::pop_front ( )
inline

◆ push_back()

template<typename T , typename Lock = std::mutex>
void dp::thread_safe_queue< T, Lock >::push_back ( T &&  value)
inline

◆ push_front()

template<typename T , typename Lock = std::mutex>
void dp::thread_safe_queue< T, Lock >::push_front ( T &&  value)
inline

◆ rotate_to_front()

template<typename T , typename Lock = std::mutex>
void dp::thread_safe_queue< T, Lock >::rotate_to_front ( const T &  item)
inline

◆ steal()

template<typename T , typename Lock = std::mutex>
std::optional< T > dp::thread_safe_queue< T, Lock >::steal ( )
inline

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