CARLA
 
载入中...
搜索中...
未找到
| 命名空间 | 宏定义 | 类型定义 | 枚举 | 函数 | 变量
ConcurrentQueue.h 文件参考
#include <atomic>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <type_traits>
#include <algorithm>
#include <utility>
#include <limits>
#include <climits>
#include <array>
#include <thread>
#include <carla/Exception.h>
+ ConcurrentQueue.h 的引用(Include)关系图:
+ 此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

struct  moodycamel::details::_hash_32_or_64< use32 >
 
struct  moodycamel::details::_hash_32_or_64< 1 >
 
struct  moodycamel::Block
 
struct  moodycamel::ExplicitProducer::BlockIndexEntry
 
struct  moodycamel::ImplicitProducer::BlockIndexEntry
 
struct  moodycamel::ExplicitProducer::BlockIndexHeader
 
struct  moodycamel::ImplicitProducer::BlockIndexHeader
 
class  moodycamel::ConcurrentQueue< T, Traits >
 
struct  moodycamel::ConcurrentQueueDefaultTraits
 
struct  moodycamel::details::ConcurrentQueueProducerTypelessBase
 
struct  moodycamel::details::const_numeric_max< T >
 
struct  moodycamel::ConsumerToken
 
struct  moodycamel::ExplicitProducer
 
struct  moodycamel::FreeList< N >
 
struct  moodycamel::FreeListNode< N >
 
struct  moodycamel::details::hash_32_or_64< size >
 
struct  moodycamel::ImplicitProducer
 
struct  moodycamel::ImplicitProducerHash
 
struct  moodycamel::ImplicitProducerKVP
 
struct  moodycamel::details::is_trivially_destructible< T >
 
union  moodycamel::details::max_align_t
 
struct  moodycamel::details::nomove_if< Enable >
 
struct  moodycamel::details::nomove_if< false >
 
struct  moodycamel::ProducerBase
 
struct  moodycamel::ProducerToken
 
struct  moodycamel::details::static_is_lock_free< T >
 
struct  moodycamel::details::static_is_lock_free< bool >
 
struct  moodycamel::details::static_is_lock_free< U * >
 
struct  moodycamel::details::static_is_lock_free_num< T >
 
struct  moodycamel::details::static_is_lock_free_num< int >
 
struct  moodycamel::details::static_is_lock_free_num< long >
 
struct  moodycamel::details::static_is_lock_free_num< long long >
 
struct  moodycamel::details::static_is_lock_free_num< short >
 
struct  moodycamel::details::static_is_lock_free_num< signed char >
 
struct  moodycamel::details::thread_id_converter< thread_id_t >
 

命名空间

namespace  moodycamel
 
namespace  moodycamel::details
 

宏定义

#define MOODYCAMEL_CATCH(...)   catch(__VA_ARGS__)
 
#define MOODYCAMEL_DELETE_FUNCTION   = delete
 
#define MOODYCAMEL_EXCEPTIONS_ENABLED
 
#define MOODYCAMEL_NOEXCEPT   noexcept
 
#define MOODYCAMEL_NOEXCEPT_ASSIGN(type, valueType, expr)   noexcept(expr)
 
#define MOODYCAMEL_NOEXCEPT_CTOR(type, valueType, expr)   noexcept(expr)
 
#define MOODYCAMEL_RETHROW   throw
 
#define MOODYCAMEL_THREADLOCAL   thread_local
 
#define MOODYCAMEL_THROW(expr)   ::carla::throw_exception(expr)
 
#define MOODYCAMEL_TRY   try
 

类型定义

typedef ::moodycamel::ConsumerToken consumer_token_t
 
typedef Traits::index_t index_t
 
typedef ::moodycamel::ProducerToken producer_token_t
 
typedef Traits::size_t size_t
 
typedef std::max_align_t moodycamel::details::std_max_align_t
 
typedef std::uintptr_t moodycamel::details::thread_id_t
 

枚举

enum  moodycamel::AllocationMode { moodycamel::CanAlloc , moodycamel::CannotAlloc }
 
enum  moodycamel::InnerQueueContext { moodycamel::implicit_context = 0 , moodycamel::explicit_context = 1 }
 

函数

void moodycamel::add_block_to_free_list (Block *block)
 
void moodycamel::add_blocks_to_free_list (Block *block)
 
ProducerBasemoodycamel::add_producer (ProducerBase *producer)
 
template<typename U >
static char * moodycamel::details::align_for (char *ptr)
 
template<typename T >
static T moodycamel::details::ceil_to_pow_2 (T x)
 
template<typename T >
static bool moodycamel::details::circular_less_than (T a, T b)
 
 ConcurrentQueue (ConcurrentQueue &&other) MOODYCAMEL_NOEXCEPT
 
 ConcurrentQueue (ConcurrentQueue const &) MOODYCAMEL_DELETE_FUNCTION
 
 ConcurrentQueue (size_t capacity=6 *BLOCK_SIZE)
 
 ConcurrentQueue (size_t minCapacity, size_t maxExplicitProducers, size_t maxImplicitProducers)
 
template<typename U >
static U * moodycamel::create ()
 
template<typename U , typename A1 >
static U * moodycamel::create (A1 &&a1)
 
template<typename U >
static U * moodycamel::create_array (size_t count)
 
template<typename It >
static auto moodycamel::details::deref_noexcept (It &it) MOODYCAMEL_NOEXCEPT -> decltype(*it)
 
template<typename U >
static void moodycamel::destroy (U *p)
 
template<typename U >
static void moodycamel::destroy_array (U *p, size_t count)
 
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)
 
ImplicitProducermoodycamel::get_or_add_implicit_producer ()
 
static size_t moodycamel::details::hash_thread_id (thread_id_t id)
 
template<AllocationMode canAlloc, typename U >
bool moodycamel::inner_enqueue (producer_token_t const &token, U &&element)
 
template<AllocationMode canAlloc, typename U >
bool moodycamel::inner_enqueue (U &&element)
 
template<AllocationMode canAlloc, typename It >
bool moodycamel::inner_enqueue_bulk (It itemFirst, size_t count)
 
template<AllocationMode canAlloc, typename It >
bool moodycamel::inner_enqueue_bulk (producer_token_t const &token, It itemFirst, size_t count)
 
static bool moodycamel::is_lock_free ()
 
static bool moodycamel::details::likely (bool x)
 
template<typename T >
static T const & moodycamel::details::nomove (T const &x)
 
ConcurrentQueueoperator= (ConcurrentQueue &&other) MOODYCAMEL_NOEXCEPT
 
ConcurrentQueueoperator= (ConcurrentQueue const &) MOODYCAMEL_DELETE_FUNCTION
 
void moodycamel::populate_initial_block_list (size_t blockCount)
 
void moodycamel::populate_initial_implicit_producer_hash ()
 
ProducerBasemoodycamel::recycle_or_create_producer (bool isExplicit)
 
ProducerBasemoodycamel::recycle_or_create_producer (bool isExplicit, bool &recycled)
 
void moodycamel::reown_producers ()
 
template<AllocationMode canAlloc>
Blockmoodycamel::requisition_block ()
 
size_t moodycamel::size_approx () const
 
void swap (ConcurrentQueue &other) MOODYCAMEL_NOEXCEPT
 
template<typename T , typename Traits >
void swap (ConcurrentQueue< T, Traits > &a, ConcurrentQueue< T, Traits > &b) MOODYCAMEL_NOEXCEPT
 
void swap (ConsumerToken &a, ConsumerToken &b) MOODYCAMEL_NOEXCEPT
 
void swap (ProducerToken &a, ProducerToken &b) MOODYCAMEL_NOEXCEPT
 
template<typename T , typename Traits >
void moodycamel::swap (typename ConcurrentQueue< T, Traits >::ImplicitProducerKVP &a, typename ConcurrentQueue< T, Traits >::ImplicitProducerKVP &b) MOODYCAMEL_NOEXCEPT
 
template<typename T , typename Traits >
void swap (typename ConcurrentQueue< T, Traits >::ImplicitProducerKVP &a, typename ConcurrentQueue< T, Traits >::ImplicitProducerKVP &b) MOODYCAMEL_NOEXCEPT
 
void moodycamel::swap_implicit_producer_hashes (ConcurrentQueue &other)
 
ConcurrentQueueswap_internal (ConcurrentQueue &other)
 
template<typename T >
static void moodycamel::details::swap_relaxed (std::atomic< T > &left, std::atomic< T > &right)
 
static thread_id_t moodycamel::details::thread_id ()
 
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 T , typename Traits = ConcurrentQueueDefaultTraits>
class moodycamel::ConcurrentQueue moodycamel::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)
 
Blockmoodycamel::try_get_block_from_free_list ()
 
Blockmoodycamel::try_get_block_from_initial_pool ()
 
static bool moodycamel::details::unlikely (bool x)
 
bool moodycamel::update_current_producer_after_rotation (consumer_token_t &token)
 
 ~ConcurrentQueue ()
 

变量

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)
 
FreeList< Blockmoodycamel::freeList
 
std::atomic< std::uint32_t > moodycamel::globalExplicitConsumerOffset
 
static const size_t IMPLICIT_INITIAL_INDEX_SIZE = static_cast<size_t>(Traits::IMPLICIT_INITIAL_INDEX_SIZE)
 
std::atomic< ImplicitProducerHash * > moodycamel::implicitProducerHash
 
std::atomic< size_tmoodycamel::implicitProducerHashCount
 
std::atomic_flag moodycamel::implicitProducerHashResizeInProgress
 
static const size_t INITIAL_IMPLICIT_PRODUCER_HASH_SIZE = static_cast<size_t>(Traits::INITIAL_IMPLICIT_PRODUCER_HASH_SIZE)
 
Blockmoodycamel::initialBlockPool
 
std::atomic< size_tmoodycamel::initialBlockPoolIndex
 
size_t moodycamel::initialBlockPoolSize
 
ImplicitProducerHash moodycamel::initialImplicitProducerHash
 
std::array< ImplicitProducerKVP, INITIAL_IMPLICIT_PRODUCER_HASH_SIZEmoodycamel::initialImplicitProducerHashEntries
 
static const thread_id_t moodycamel::details::invalid_thread_id = 0
 
static const thread_id_t moodycamel::details::invalid_thread_id2 = 1
 
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)
 
std::atomic< std::uint32_t > moodycamel::nextExplicitConsumerId
 
std::atomic< std::uint32_t > moodycamel::producerCount
 
std::atomic< ProducerBase * > moodycamel::producerListTail
 
enum moodycamel::AllocationMode moodycamel::try_dequeue_bulk_from_producer
 

宏定义说明

◆ MOODYCAMEL_CATCH

#define MOODYCAMEL_CATCH ( ...)    catch(__VA_ARGS__)

◆ MOODYCAMEL_DELETE_FUNCTION

#define MOODYCAMEL_DELETE_FUNCTION   = delete

在文件 ConcurrentQueue.h228 行定义.

◆ MOODYCAMEL_EXCEPTIONS_ENABLED

#define MOODYCAMEL_EXCEPTIONS_ENABLED

在文件 ConcurrentQueue.h155 行定义.

◆ MOODYCAMEL_NOEXCEPT

#define MOODYCAMEL_NOEXCEPT   noexcept

在文件 ConcurrentQueue.h202 行定义.

◆ MOODYCAMEL_NOEXCEPT_ASSIGN

#define MOODYCAMEL_NOEXCEPT_ASSIGN ( type,
valueType,
expr )   noexcept(expr)

◆ MOODYCAMEL_NOEXCEPT_CTOR

#define MOODYCAMEL_NOEXCEPT_CTOR ( type,
valueType,
expr )   noexcept(expr)

◆ MOODYCAMEL_RETHROW

#define MOODYCAMEL_RETHROW   throw

◆ MOODYCAMEL_THREADLOCAL

#define MOODYCAMEL_THREADLOCAL   thread_local

在文件 ConcurrentQueue.h142 行定义.

被这些函数引用 moodycamel::details::thread_id().

◆ MOODYCAMEL_THROW

#define MOODYCAMEL_THROW ( expr)    ::carla::throw_exception(expr)

在文件 ConcurrentQueue.h173 行定义.

◆ MOODYCAMEL_TRY

#define MOODYCAMEL_TRY   try

类型定义说明

◆ consumer_token_t

在文件 ConcurrentQueue.h1343 行定义.

◆ index_t

typedef Traits::index_t index_t

在文件 ConcurrentQueue.h1345 行定义.

◆ producer_token_t

在文件 ConcurrentQueue.h1341 行定义.

◆ size_t

typedef Traits::size_t size_t

在文件 ConcurrentQueue.h1347 行定义.

函数说明

◆ ConcurrentQueue() [1/4]

try_dequeue_bulk_from_producer::ConcurrentQueue ( ConcurrentQueue && other)

在文件 ConcurrentQueue.h1509 行定义.

◆ ConcurrentQueue() [2/4]

try_dequeue_bulk_from_producer::ConcurrentQueue ( ConcurrentQueue const & )

◆ ConcurrentQueue() [3/4]

try_dequeue_bulk_from_producer::ConcurrentQueue ( size_t capacity = 6 * BLOCK_SIZE)
explicit

◆ ConcurrentQueue() [4/4]

try_dequeue_bulk_from_producer::ConcurrentQueue ( size_t minCapacity,
size_t maxExplicitProducers,
size_t maxImplicitProducers )

在文件 ConcurrentQueue.h1427 行定义.

◆ enqueue() [1/4]

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

在文件 ConcurrentQueue.h1624 行定义.

◆ enqueue() [2/4]

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

在文件 ConcurrentQueue.h1615 行定义.

◆ enqueue() [3/4]

bool try_dequeue_bulk_from_producer::enqueue ( T && item)
inline

在文件 ConcurrentQueue.h1605 行定义.

◆ enqueue() [4/4]

bool try_dequeue_bulk_from_producer::enqueue ( T const & item)
inline

在文件 ConcurrentQueue.h1594 行定义.

◆ enqueue_bulk() [1/2]

template<typename It >
bool try_dequeue_bulk_from_producer::enqueue_bulk ( It itemFirst,
size_t count )

在文件 ConcurrentQueue.h1635 行定义.

◆ enqueue_bulk() [2/2]

template<typename It >
bool try_dequeue_bulk_from_producer::enqueue_bulk ( producer_token_t const & token,
It itemFirst,
size_t count )

在文件 ConcurrentQueue.h1648 行定义.

◆ operator=() [1/2]

ConcurrentQueue & try_dequeue_bulk_from_producer::operator= ( ConcurrentQueue && other)
inline

在文件 ConcurrentQueue.h1543 行定义.

引用了 moodycamel::FreeList< N >::add_knowing_refcount_is_zero().

+ 函数调用图:

◆ operator=() [2/2]

ConcurrentQueue & try_dequeue_bulk_from_producer::operator= ( ConcurrentQueue const & )

◆ swap() [1/5]

void try_dequeue_bulk_from_producer::swap ( ConcurrentQueue & other)
inline

在文件 ConcurrentQueue.h1553 行定义.

◆ swap() [2/5]

template<typename T , typename Traits >
void swap ( ConcurrentQueue< T, Traits > & a,
ConcurrentQueue< T, Traits > & b )
inline

在文件 ConcurrentQueue.h3754 行定义.

引用了 moodycamel::ConcurrentQueue< T, Traits >::swap().

+ 函数调用图:

◆ swap() [3/5]

void swap ( ConsumerToken & a,
ConsumerToken & b )
inline

在文件 ConcurrentQueue.h3764 行定义.

◆ swap() [4/5]

void swap ( ProducerToken & a,
ProducerToken & b )
inline

在文件 ConcurrentQueue.h3759 行定义.

◆ swap() [5/5]

template<typename T , typename Traits >
void swap ( typename ConcurrentQueue< T, Traits >::ImplicitProducerKVP & a,
typename ConcurrentQueue< T, Traits >::ImplicitProducerKVP & b )
inline

在文件 ConcurrentQueue.h3770 行定义.

◆ swap_internal()

ConcurrentQueue & try_dequeue_bulk_from_producer::swap_internal ( ConcurrentQueue & other)
private

◆ try_dequeue() [1/2]

template<typename U >
bool try_dequeue_bulk_from_producer::try_dequeue ( consumer_token_t & token,
U & item )

在文件 ConcurrentQueue.h1777 行定义.

◆ try_dequeue() [2/2]

template<typename U >
bool try_dequeue_bulk_from_producer::try_dequeue ( U & item)

在文件 ConcurrentQueue.h1722 行定义.

◆ try_dequeue_bulk() [1/2]

template<typename It >
size_t try_dequeue_bulk_from_producer::try_dequeue_bulk ( consumer_token_t & token,
It itemFirst,
size_t max )

◆ try_dequeue_bulk() [2/2]

template<typename It >
size_t try_dequeue_bulk_from_producer::try_dequeue_bulk ( It itemFirst,
size_t max )

在文件 ConcurrentQueue.h1823 行定义.

引用了 moodycamel::details::ceil_to_pow_2(), moodycamel::ExplicitProducer::new_block_index(), moodycamel::ProducerBase::parent , 以及 moodycamel::ExplicitProducer::pr_blockIndexSize.

+ 函数调用图:

◆ try_dequeue_from_producer()

template<typename U >
bool try_dequeue_bulk_from_producer::try_dequeue_from_producer ( producer_token_t const & producer,
U & item )
inline

◆ try_dequeue_non_interleaved()

template<typename U >
bool try_dequeue_bulk_from_producer::try_dequeue_non_interleaved ( U & item)

在文件 ConcurrentQueue.h1762 行定义.

◆ try_enqueue() [1/4]

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

在文件 ConcurrentQueue.h1686 行定义.

◆ try_enqueue() [2/4]

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

在文件 ConcurrentQueue.h1678 行定义.

引用了 BLOCK_SIZE , 以及 moodycamel::Block::emptyFlags.

◆ try_enqueue() [3/4]

bool try_dequeue_bulk_from_producer::try_enqueue ( T && item)
inline

在文件 ConcurrentQueue.h1669 行定义.

◆ try_enqueue() [4/4]

bool try_dequeue_bulk_from_producer::try_enqueue ( T const & item)
inline

在文件 ConcurrentQueue.h1658 行定义.

◆ try_enqueue_bulk() [1/2]

template<typename It >
bool try_dequeue_bulk_from_producer::try_enqueue_bulk ( It itemFirst,
size_t count )

◆ try_enqueue_bulk() [2/2]

template<typename It >
bool try_dequeue_bulk_from_producer::try_enqueue_bulk ( producer_token_t const & token,
It itemFirst,
size_t count )

在文件 ConcurrentQueue.h1711 行定义.

◆ ~ConcurrentQueue()

try_dequeue_bulk_from_producer::~ConcurrentQueue ( )

在文件 ConcurrentQueue.h1458 行定义.

变量说明

◆ 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

在文件 ConcurrentQueue.h1360 行定义.

◆ EXPLICIT_INITIAL_INDEX_SIZE

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

在文件 ConcurrentQueue.h1354 行定义.

◆ IMPLICIT_INITIAL_INDEX_SIZE

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

在文件 ConcurrentQueue.h1356 行定义.

◆ 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