Ardour  9.0-pre0-582-g084a23a80d
PBD::MPMCQueue< T > Class Template Reference

#include <mpmc_queue.h>

Classes

struct  cell_t
 

Public Member Functions

 MPMCQueue (size_t buffer_size=8)
 
 ~MPMCQueue ()
 
size_t capacity () const
 
void reserve (size_t buffer_size)
 
void clear ()
 
bool push_back (T const &data)
 
bool pop_front (T &data)
 

Static Public Member Functions

static size_t power_of_two_size (size_t sz)
 

Private Attributes

char _pad0 [64]
 
cell_t_buffer
 
size_t _buffer_mask
 
char _pad1 [64 - sizeof(cell_t *) - sizeof(size_t)]
 
std::atomic< size_t > _enqueue_pos
 
char _pad2 [64 - sizeof(size_t)]
 
std::atomic< size_t > _dequeue_pos
 
char _pad3 [64 - sizeof(size_t)]
 

Detailed Description

template<typename T>
class PBD::MPMCQueue< T >

Definition at line 38 of file mpmc_queue.h.

Constructor & Destructor Documentation

◆ MPMCQueue()

template<typename T >
PBD::MPMCQueue< T >::MPMCQueue ( size_t  buffer_size = 8)
inline

Definition at line 41 of file mpmc_queue.h.

◆ ~MPMCQueue()

template<typename T >
PBD::MPMCQueue< T >::~MPMCQueue ( )
inline

Definition at line 48 of file mpmc_queue.h.

Member Function Documentation

◆ capacity()

template<typename T >
size_t PBD::MPMCQueue< T >::capacity ( ) const
inline

Definition at line 53 of file mpmc_queue.h.

◆ clear()

template<typename T >
void PBD::MPMCQueue< T >::clear ( )
inline

Definition at line 80 of file mpmc_queue.h.

◆ pop_front()

template<typename T >
bool PBD::MPMCQueue< T >::pop_front ( T &  data)
inline

Definition at line 118 of file mpmc_queue.h.

◆ power_of_two_size()

template<typename T >
static size_t PBD::MPMCQueue< T >::power_of_two_size ( size_t  sz)
inlinestatic

Definition at line 58 of file mpmc_queue.h.

◆ push_back()

template<typename T >
bool PBD::MPMCQueue< T >::push_back ( T const &  data)
inline

Definition at line 90 of file mpmc_queue.h.

◆ reserve()

template<typename T >
void PBD::MPMCQueue< T >::reserve ( size_t  buffer_size)
inline

Definition at line 66 of file mpmc_queue.h.

Member Data Documentation

◆ _buffer

template<typename T >
cell_t* PBD::MPMCQueue< T >::_buffer
private

Definition at line 151 of file mpmc_queue.h.

◆ _buffer_mask

template<typename T >
size_t PBD::MPMCQueue< T >::_buffer_mask
private

Definition at line 152 of file mpmc_queue.h.

◆ _dequeue_pos

template<typename T >
std::atomic<size_t> PBD::MPMCQueue< T >::_dequeue_pos
private

Definition at line 156 of file mpmc_queue.h.

◆ _enqueue_pos

template<typename T >
std::atomic<size_t> PBD::MPMCQueue< T >::_enqueue_pos
private

Definition at line 154 of file mpmc_queue.h.

◆ _pad0

template<typename T >
char PBD::MPMCQueue< T >::_pad0[64]
private

Definition at line 150 of file mpmc_queue.h.

◆ _pad1

template<typename T >
char PBD::MPMCQueue< T >::_pad1[64 - sizeof(cell_t *) - sizeof(size_t)]
private

Definition at line 153 of file mpmc_queue.h.

◆ _pad2

template<typename T >
char PBD::MPMCQueue< T >::_pad2[64 - sizeof(size_t)]
private

Definition at line 155 of file mpmc_queue.h.

◆ _pad3

template<typename T >
char PBD::MPMCQueue< T >::_pad3[64 - sizeof(size_t)]
private

Definition at line 157 of file mpmc_queue.h.


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