Classes | Public Types | 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 Types

typedef T value_type
 

Public Member Functions

template<typename... Args>
AE_FORCEINLINE bool emplace (Args &&... args) AE_NO_TSAN
 
AE_FORCEINLINE bool enqueue (T &&element) AE_NO_TSAN
 
AE_FORCEINLINE bool enqueue (T const &element) AE_NO_TSAN
 
size_t max_capacity () const
 
ReaderWriterQueueoperator= (ReaderWriterQueue &&other) AE_NO_TSAN
 
T * peek () const AE_NO_TSAN
 
bool pop () AE_NO_TSAN
 
AE_NO_TSAN ReaderWriterQueue (ReaderWriterQueue &&other)
 
AE_NO_TSAN ReaderWriterQueue (size_t size=15)
 
size_t size_approx () const AE_NO_TSAN
 
template<typename U >
bool try_dequeue (U &result) AE_NO_TSAN
 
template<typename... Args>
AE_FORCEINLINE bool try_emplace (Args &&... args) AE_NO_TSAN
 
AE_FORCEINLINE bool try_enqueue (T &&element) AE_NO_TSAN
 
AE_FORCEINLINE bool try_enqueue (T const &element) AE_NO_TSAN
 
AE_NO_TSAN ~ReaderWriterQueue ()
 

Private Types

enum  AllocationMode { CanAlloc, CannotAlloc }
 

Private Member Functions

template<AllocationMode canAlloc, typename... Args>
bool inner_enqueue (Args &&... args) AE_NO_TSAN
 
ReaderWriterQueueoperator= (ReaderWriterQueue const &)
 
 ReaderWriterQueue (ReaderWriterQueue const &)
 

Static Private Member Functions

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

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 61 of file readerwriterqueue.h.

Member Typedef Documentation

◆ value_type

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

Definition at line 84 of file readerwriterqueue.h.

Member Enumeration Documentation

◆ AllocationMode

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

Definition at line 537 of file readerwriterqueue.h.

Constructor & Destructor Documentation

◆ ReaderWriterQueue() [1/3]

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

Definition at line 90 of file readerwriterqueue.h.

◆ ReaderWriterQueue() [2/3]

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

Definition at line 157 of file readerwriterqueue.h.

◆ ~ReaderWriterQueue()

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

Definition at line 197 of file readerwriterqueue.h.

◆ ReaderWriterQueue() [3/3]

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 664 of file readerwriterqueue.h.

Member Function Documentation

◆ align_for()

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 689 of file readerwriterqueue.h.

◆ ceilToPow2()

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 673 of file readerwriterqueue.h.

◆ emplace()

template<typename T , size_t MAX_BLOCK_SIZE = 512>
template<typename... Args>
AE_FORCEINLINE bool moodycamel::ReaderWriterQueue< T, MAX_BLOCK_SIZE >::emplace ( Args &&...  args)
inline

Definition at line 269 of file readerwriterqueue.h.

◆ enqueue() [1/2]

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 261 of file readerwriterqueue.h.

◆ enqueue() [2/2]

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 253 of file readerwriterqueue.h.

◆ inner_enqueue()

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

Definition at line 545 of file readerwriterqueue.h.

◆ make_block()

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 759 of file readerwriterqueue.h.

◆ max_capacity()

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

Definition at line 522 of file readerwriterqueue.h.

◆ operator=() [1/2]

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

Definition at line 183 of file readerwriterqueue.h.

◆ operator=() [2/2]

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 669 of file readerwriterqueue.h.

◆ peek()

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

Definition at line 381 of file readerwriterqueue.h.

◆ pop()

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

Definition at line 426 of file readerwriterqueue.h.

◆ size_approx()

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

Definition at line 497 of file readerwriterqueue.h.

◆ try_dequeue()

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 279 of file readerwriterqueue.h.

◆ try_emplace()

template<typename T , size_t MAX_BLOCK_SIZE = 512>
template<typename... Args>
AE_FORCEINLINE bool moodycamel::ReaderWriterQueue< T, MAX_BLOCK_SIZE >::try_emplace ( Args &&...  args)
inline

Definition at line 244 of file readerwriterqueue.h.

◆ try_enqueue() [1/2]

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 236 of file readerwriterqueue.h.

◆ try_enqueue() [2/2]

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 228 of file readerwriterqueue.h.

Member Data Documentation

◆ cachelineFiller

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 778 of file readerwriterqueue.h.

◆ dequeuing

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

Definition at line 785 of file readerwriterqueue.h.

◆ enqueuing

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

Definition at line 784 of file readerwriterqueue.h.

◆ frontBlock

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

Definition at line 776 of file readerwriterqueue.h.

◆ largestBlockSize

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

Definition at line 781 of file readerwriterqueue.h.

◆ tailBlock

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

Definition at line 779 of file readerwriterqueue.h.


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


pf_driver
Author(s): Harsh Deshpande
autogenerated on Sun Feb 4 2024 03:32:56