mcx::utils::MpmcQueue

mcx::utils::MpmcQueue

More…

Protected Classes

Name
struct Cell

Public Functions

Name
MpmcQueue(uint32_t buffer_length)
virtual ~MpmcQueue()
bool write(const T & in, bool no_drop =false)
uint32_t read(T * out) const
void drop()
uint32_t pos() const
uint32_t size() const

Protected Attributes

Name
Cell *const buffer_
uint32_t const buffer_mask_
std::atomic< uint32_t > enqueue_pos_
std::atomic< uint32_t > enqueue_pos_size_
std::atomic< uint32_t > dequeue_pos_
std::atomic< uint32_t > dequeue_pos_size_

Detailed Description

template <typename T >
class mcx::utils::MpmcQueue;

Public Functions Documentation

function MpmcQueue

inline explicit MpmcQueue(
    uint32_t buffer_length
)

function ~MpmcQueue

inline virtual ~MpmcQueue()

function write

inline bool write(
    const T & in,
    bool no_drop =false
)

function read

inline uint32_t read(
    T * out
) const

function drop

inline void drop()

function pos

inline uint32_t pos() const

function size

inline uint32_t size() const

Protected Attributes Documentation

variable buffer_

Cell *const buffer_;

variable buffer_mask_

uint32_t const buffer_mask_;

variable enqueue_pos_

std::atomic< uint32_t > enqueue_pos_ {};

variable enqueue_pos_size_

std::atomic< uint32_t > enqueue_pos_size_ {};

variable dequeue_pos_

std::atomic< uint32_t > dequeue_pos_ {};

variable dequeue_pos_size_

std::atomic< uint32_t > dequeue_pos_size_ {};

Updated on 2022-04-05 at 16:21:27 +0200