Classes | Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
moodycamel::ReaderWriterQueue< T, MAX_BLOCK_SIZE > Class Template Reference

#include <readerwriterqueue.h>

Classes

struct  Block
 
struct  ReentrantGuard
 

Public Member Functions

AE_FORCEINLINE bool enqueue (T const &element)
 
AE_FORCEINLINE bool enqueue (T &&element)
 
T * peek ()
 
bool pop ()
 
 ReaderWriterQueue (size_t maxSize=15)
 
size_t size_approx () const
 
template<typename U >
bool try_dequeue (U &result)
 
AE_FORCEINLINE bool try_enqueue (T const &element)
 
AE_FORCEINLINE bool try_enqueue (T &&element)
 
 ~ReaderWriterQueue ()
 

Private Types

enum  AllocationMode { CanAlloc, CannotAlloc }
 

Private Member Functions

template<AllocationMode canAlloc, typename U >
bool inner_enqueue (U &&element)
 
ReaderWriterQueueoperator= (ReaderWriterQueue const &)
 
 ReaderWriterQueue (ReaderWriterQueue const &)
 

Static Private Member Functions

template<typename U >
static AE_FORCEINLINE char * align_for (char *ptr)
 
static AE_FORCEINLINE size_t ceilToPow2 (size_t x)
 
static Blockmake_block (size_t capacity)
 

Private Attributes

char cachelineFiller [MOODYCAMEL_CACHE_LINE_SIZE-sizeof(weak_atomic< Block * >)]
 
bool dequeuing
 
bool enqueuing
 
weak_atomic< Block * > frontBlock
 
size_t largestBlockSize
 
weak_atomic< Block * > tailBlock
 

Detailed Description

template<typename T, size_t MAX_BLOCK_SIZE = 512>
class moodycamel::ReaderWriterQueue< T, MAX_BLOCK_SIZE >

Definition at line 53 of file readerwriterqueue.h.

Member Enumeration Documentation

template<typename T, size_t MAX_BLOCK_SIZE = 512>
enum moodycamel::ReaderWriterQueue::AllocationMode
private
Enumerator
CanAlloc 
CannotAlloc 

Definition at line 447 of file readerwriterqueue.h.

Constructor & Destructor Documentation

template<typename T, size_t MAX_BLOCK_SIZE = 512>
moodycamel::ReaderWriterQueue< T, MAX_BLOCK_SIZE >::ReaderWriterQueue ( size_t  maxSize = 15)
inlineexplicit

Definition at line 80 of file readerwriterqueue.h.

template<typename T, size_t MAX_BLOCK_SIZE = 512>
moodycamel::ReaderWriterQueue< T, MAX_BLOCK_SIZE >::~ReaderWriterQueue ( )
inline

Definition at line 148 of file readerwriterqueue.h.

template<typename T, size_t MAX_BLOCK_SIZE = 512>
moodycamel::ReaderWriterQueue< T, MAX_BLOCK_SIZE >::ReaderWriterQueue ( ReaderWriterQueue< T, MAX_BLOCK_SIZE > const &  )
inlineprivate

Definition at line 558 of file readerwriterqueue.h.

Member Function Documentation

template<typename T, size_t MAX_BLOCK_SIZE = 512>
template<typename U >
static AE_FORCEINLINE char* moodycamel::ReaderWriterQueue< T, MAX_BLOCK_SIZE >::align_for ( char *  ptr)
inlinestaticprivate

Definition at line 583 of file readerwriterqueue.h.

template<typename T, size_t MAX_BLOCK_SIZE = 512>
static AE_FORCEINLINE size_t moodycamel::ReaderWriterQueue< T, MAX_BLOCK_SIZE >::ceilToPow2 ( size_t  x)
inlinestaticprivate

Definition at line 567 of file readerwriterqueue.h.

template<typename T, size_t MAX_BLOCK_SIZE = 512>
AE_FORCEINLINE bool moodycamel::ReaderWriterQueue< T, MAX_BLOCK_SIZE >::enqueue ( T const &  element)
inline

Definition at line 195 of file readerwriterqueue.h.

template<typename T, size_t MAX_BLOCK_SIZE = 512>
AE_FORCEINLINE bool moodycamel::ReaderWriterQueue< T, MAX_BLOCK_SIZE >::enqueue ( T &&  element)
inline

Definition at line 203 of file readerwriterqueue.h.

template<typename T, size_t MAX_BLOCK_SIZE = 512>
template<AllocationMode canAlloc, typename U >
bool moodycamel::ReaderWriterQueue< T, MAX_BLOCK_SIZE >::inner_enqueue ( U &&  element)
inlineprivate

Definition at line 454 of file readerwriterqueue.h.

template<typename T, size_t MAX_BLOCK_SIZE = 512>
static Block* moodycamel::ReaderWriterQueue< T, MAX_BLOCK_SIZE >::make_block ( size_t  capacity)
inlinestaticprivate

Definition at line 658 of file readerwriterqueue.h.

template<typename T, size_t MAX_BLOCK_SIZE = 512>
ReaderWriterQueue& moodycamel::ReaderWriterQueue< T, MAX_BLOCK_SIZE >::operator= ( ReaderWriterQueue< T, MAX_BLOCK_SIZE > const &  )
inlineprivate

Definition at line 563 of file readerwriterqueue.h.

template<typename T, size_t MAX_BLOCK_SIZE = 512>
T* moodycamel::ReaderWriterQueue< T, MAX_BLOCK_SIZE >::peek ( )
inline

Definition at line 314 of file readerwriterqueue.h.

template<typename T, size_t MAX_BLOCK_SIZE = 512>
bool moodycamel::ReaderWriterQueue< T, MAX_BLOCK_SIZE >::pop ( )
inline

Definition at line 359 of file readerwriterqueue.h.

template<typename T, size_t MAX_BLOCK_SIZE = 512>
size_t moodycamel::ReaderWriterQueue< T, MAX_BLOCK_SIZE >::size_approx ( ) const
inline

Definition at line 430 of file readerwriterqueue.h.

template<typename T, size_t MAX_BLOCK_SIZE = 512>
template<typename U >
bool moodycamel::ReaderWriterQueue< T, MAX_BLOCK_SIZE >::try_dequeue ( U &  result)
inline

Definition at line 212 of file readerwriterqueue.h.

template<typename T, size_t MAX_BLOCK_SIZE = 512>
AE_FORCEINLINE bool moodycamel::ReaderWriterQueue< T, MAX_BLOCK_SIZE >::try_enqueue ( T const &  element)
inline

Definition at line 179 of file readerwriterqueue.h.

template<typename T, size_t MAX_BLOCK_SIZE = 512>
AE_FORCEINLINE bool moodycamel::ReaderWriterQueue< T, MAX_BLOCK_SIZE >::try_enqueue ( T &&  element)
inline

Definition at line 187 of file readerwriterqueue.h.

Member Data Documentation

template<typename T, size_t MAX_BLOCK_SIZE = 512>
char moodycamel::ReaderWriterQueue< T, MAX_BLOCK_SIZE >::cachelineFiller[MOODYCAMEL_CACHE_LINE_SIZE-sizeof(weak_atomic< Block * >)]
private

Definition at line 677 of file readerwriterqueue.h.

template<typename T, size_t MAX_BLOCK_SIZE = 512>
bool moodycamel::ReaderWriterQueue< T, MAX_BLOCK_SIZE >::dequeuing
private

Definition at line 684 of file readerwriterqueue.h.

template<typename T, size_t MAX_BLOCK_SIZE = 512>
bool moodycamel::ReaderWriterQueue< T, MAX_BLOCK_SIZE >::enqueuing
private

Definition at line 683 of file readerwriterqueue.h.

template<typename T, size_t MAX_BLOCK_SIZE = 512>
weak_atomic<Block*> moodycamel::ReaderWriterQueue< T, MAX_BLOCK_SIZE >::frontBlock
private

Definition at line 675 of file readerwriterqueue.h.

template<typename T, size_t MAX_BLOCK_SIZE = 512>
size_t moodycamel::ReaderWriterQueue< T, MAX_BLOCK_SIZE >::largestBlockSize
private

Definition at line 680 of file readerwriterqueue.h.

template<typename T, size_t MAX_BLOCK_SIZE = 512>
weak_atomic<Block*> moodycamel::ReaderWriterQueue< T, MAX_BLOCK_SIZE >::tailBlock
private

Definition at line 678 of file readerwriterqueue.h.


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


ur_modern_driver
Author(s): Thomas Timm Andersen, Simon Rasmussen
autogenerated on Fri Jun 26 2020 03:37:01