Workspace 7.0.2
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
ConcurrentQueue< T, Traits > Class Template Reference

#include <Workspace/Application/concurrentqueue.h>

Inheritance diagram for ConcurrentQueue< T, Traits >:
[legend]

Public Types

typedef ::moodycamel::ConsumerToken consumer_token_t
 
typedef Traits::index_t index_t
 
typedef ::moodycamel::ProducerToken producer_token_t
 
typedef Traits::size_t size_t
 

Public Member Functions

 ConcurrentQueue (ConcurrentQueue &&other) noexcept
 
 ConcurrentQueue (ConcurrentQueue const &)=delete
 
 ConcurrentQueue (size_t capacity=32 *BLOCK_SIZE)
 
 ConcurrentQueue (size_t minCapacity, size_t maxExplicitProducers, size_t maxImplicitProducers)
 
 ~ConcurrentQueue ()
 
bool enqueue (producer_token_t const &token, T &&item)
 
bool enqueue (producer_token_t const &token, T const &item)
 
bool enqueue (T &&item)
 
bool enqueue (T const &item)
 
template<typename It >
bool enqueue_bulk (It itemFirst, size_t count)
 
template<typename It >
bool enqueue_bulk (producer_token_t const &token, It itemFirst, size_t count)
 
ConcurrentQueueoperator= (ConcurrentQueue &&other) noexcept
 
ConcurrentQueueoperator= (ConcurrentQueue const &)=delete
 
size_t size_approx () const
 
void swap (ConcurrentQueue &other) noexcept
 
template<typename U >
bool try_dequeue (consumer_token_t &token, U &item)
 
template<typename U >
bool try_dequeue (U &item)
 
template<typename It >
size_t try_dequeue_bulk (consumer_token_t &token, It itemFirst, size_t max)
 
template<typename It >
size_t try_dequeue_bulk (It itemFirst, size_t max)
 
template<typename It >
size_t try_dequeue_bulk_from_producer (producer_token_t const &producer, It itemFirst, size_t max)
 
template<typename U >
bool try_dequeue_from_producer (producer_token_t const &producer, U &item)
 
template<typename U >
bool try_dequeue_non_interleaved (U &item)
 
bool try_enqueue (producer_token_t const &token, T &&item)
 
bool try_enqueue (producer_token_t const &token, T const &item)
 
bool try_enqueue (T &&item)
 
bool try_enqueue (T const &item)
 
template<typename It >
bool try_enqueue_bulk (It itemFirst, size_t count)
 
template<typename It >
bool try_enqueue_bulk (producer_token_t const &token, It itemFirst, size_t count)
 

Static Public Member Functions

static constexpr bool is_lock_free ()
 

Static Public Attributes

static const size_t BLOCK_SIZE = static_cast<size_t>(Traits::BLOCK_SIZE)
 
static const size_t EXPLICIT_BLOCK_EMPTY_COUNTER_THRESHOLD = static_cast<size_t>(Traits::EXPLICIT_BLOCK_EMPTY_COUNTER_THRESHOLD)
 
static const std::uint32_t EXPLICIT_CONSUMER_CONSUMPTION_QUOTA_BEFORE_ROTATE = static_cast<std::uint32_t>(Traits::EXPLICIT_CONSUMER_CONSUMPTION_QUOTA_BEFORE_ROTATE)
 
static const size_t EXPLICIT_INITIAL_INDEX_SIZE = static_cast<size_t>(Traits::EXPLICIT_INITIAL_INDEX_SIZE)
 
static const size_t IMPLICIT_INITIAL_INDEX_SIZE = static_cast<size_t>(Traits::IMPLICIT_INITIAL_INDEX_SIZE)
 
static const size_t INITIAL_IMPLICIT_PRODUCER_HASH_SIZE = static_cast<size_t>(Traits::INITIAL_IMPLICIT_PRODUCER_HASH_SIZE)
 
static const size_t MAX_SUBQUEUE_SIZE = (details::const_numeric_max<size_t>::value - static_cast<size_t>(Traits::MAX_SUBQUEUE_SIZE) < BLOCK_SIZE) ? details::const_numeric_max<size_t>::value : ((static_cast<size_t>(Traits::MAX_SUBQUEUE_SIZE) + (BLOCK_SIZE - 1)) / BLOCK_SIZE * BLOCK_SIZE)
 

Member Typedef Documentation

◆ consumer_token_t

◆ index_t

typedef Traits::index_t index_t

◆ producer_token_t

◆ size_t

typedef Traits::size_t size_t

Constructor & Destructor Documentation

◆ ConcurrentQueue() [1/4]

ConcurrentQueue ( size_t  capacity = 32 * BLOCK_SIZE)
inlineexplicit

◆ ConcurrentQueue() [2/4]

ConcurrentQueue ( size_t  minCapacity,
size_t  maxExplicitProducers,
size_t  maxImplicitProducers 
)
inline

◆ ~ConcurrentQueue()

~ConcurrentQueue ( )
inline

◆ ConcurrentQueue() [3/4]

ConcurrentQueue ( ConcurrentQueue< T, Traits > const &  )
delete

◆ ConcurrentQueue() [4/4]

ConcurrentQueue ( ConcurrentQueue< T, Traits > &&  other)
inlinenoexcept

Member Function Documentation

◆ enqueue() [1/4]

bool enqueue ( producer_token_t const &  token,
T &&  item 
)
inline

◆ enqueue() [2/4]

bool enqueue ( producer_token_t const &  token,
T const &  item 
)
inline

◆ enqueue() [3/4]

bool enqueue ( T &&  item)
inline

◆ enqueue() [4/4]

bool enqueue ( T const &  item)
inline

◆ enqueue_bulk() [1/2]

bool enqueue_bulk ( It  itemFirst,
size_t  count 
)
inline

◆ enqueue_bulk() [2/2]

bool enqueue_bulk ( producer_token_t const &  token,
It  itemFirst,
size_t  count 
)
inline

◆ is_lock_free()

static constexpr bool is_lock_free ( )
inlinestaticconstexpr

◆ operator=() [1/2]

ConcurrentQueue & operator= ( ConcurrentQueue< T, Traits > &&  other)
inlinenoexcept

◆ operator=() [2/2]

ConcurrentQueue & operator= ( ConcurrentQueue< T, Traits > const &  )
delete

◆ size_approx()

size_t size_approx ( ) const
inline

◆ swap()

void swap ( ConcurrentQueue< T, Traits > &  other)
inlinenoexcept

◆ try_dequeue() [1/2]

bool try_dequeue ( consumer_token_t token,
U &  item 
)
inline

◆ try_dequeue() [2/2]

bool try_dequeue ( U &  item)
inline

◆ try_dequeue_bulk() [1/2]

size_t try_dequeue_bulk ( consumer_token_t token,
It  itemFirst,
size_t  max 
)
inline

◆ try_dequeue_bulk() [2/2]

size_t try_dequeue_bulk ( It  itemFirst,
size_t  max 
)
inline

◆ try_dequeue_bulk_from_producer()

size_t try_dequeue_bulk_from_producer ( producer_token_t const &  producer,
It  itemFirst,
size_t  max 
)
inline

◆ try_dequeue_from_producer()

bool try_dequeue_from_producer ( producer_token_t const &  producer,
U &  item 
)
inline

◆ try_dequeue_non_interleaved()

bool try_dequeue_non_interleaved ( U &  item)
inline

◆ try_enqueue() [1/4]

bool try_enqueue ( producer_token_t const &  token,
T &&  item 
)
inline

◆ try_enqueue() [2/4]

bool try_enqueue ( producer_token_t const &  token,
T const &  item 
)
inline

◆ try_enqueue() [3/4]

bool try_enqueue ( T &&  item)
inline

◆ try_enqueue() [4/4]

bool try_enqueue ( T const &  item)
inline

◆ try_enqueue_bulk() [1/2]

bool try_enqueue_bulk ( It  itemFirst,
size_t  count 
)
inline

◆ try_enqueue_bulk() [2/2]

bool try_enqueue_bulk ( producer_token_t const &  token,
It  itemFirst,
size_t  count 
)
inline

Member Data Documentation

◆ BLOCK_SIZE

const size_t BLOCK_SIZE = static_cast<size_t>(Traits::BLOCK_SIZE)
static

◆ EXPLICIT_BLOCK_EMPTY_COUNTER_THRESHOLD

const size_t EXPLICIT_BLOCK_EMPTY_COUNTER_THRESHOLD = static_cast<size_t>(Traits::EXPLICIT_BLOCK_EMPTY_COUNTER_THRESHOLD)
static

◆ EXPLICIT_CONSUMER_CONSUMPTION_QUOTA_BEFORE_ROTATE

const std::uint32_t EXPLICIT_CONSUMER_CONSUMPTION_QUOTA_BEFORE_ROTATE = static_cast<std::uint32_t>(Traits::EXPLICIT_CONSUMER_CONSUMPTION_QUOTA_BEFORE_ROTATE)
static

◆ EXPLICIT_INITIAL_INDEX_SIZE

const size_t EXPLICIT_INITIAL_INDEX_SIZE = static_cast<size_t>(Traits::EXPLICIT_INITIAL_INDEX_SIZE)
static

◆ IMPLICIT_INITIAL_INDEX_SIZE

const size_t IMPLICIT_INITIAL_INDEX_SIZE = static_cast<size_t>(Traits::IMPLICIT_INITIAL_INDEX_SIZE)
static

◆ INITIAL_IMPLICIT_PRODUCER_HASH_SIZE

const size_t INITIAL_IMPLICIT_PRODUCER_HASH_SIZE = static_cast<size_t>(Traits::INITIAL_IMPLICIT_PRODUCER_HASH_SIZE)
static

◆ MAX_SUBQUEUE_SIZE

const size_t MAX_SUBQUEUE_SIZE = (details::const_numeric_max<size_t>::value - static_cast<size_t>(Traits::MAX_SUBQUEUE_SIZE) < BLOCK_SIZE) ? details::const_numeric_max<size_t>::value : ((static_cast<size_t>(Traits::MAX_SUBQUEUE_SIZE) + (BLOCK_SIZE - 1)) / BLOCK_SIZE * BLOCK_SIZE)
static