Ardour  9.0-pre0-386-g96ef4d20f2
PBD::RingBuffer< T > Class Template Reference

#include <ringbuffer.h>

Classes

struct  rw_vector
 

Public Member Functions

 RingBuffer (size_t sz)
 
virtual ~RingBuffer ()
 
void reset ()
 
void set (size_t r, size_t w)
 
size_t read (T *dest, size_t cnt)
 
size_t write (T const *src, size_t cnt)
 
void get_read_vector (rw_vector *)
 
void get_write_vector (rw_vector *)
 
void decrement_read_idx (size_t cnt)
 
void increment_read_idx (size_t cnt)
 
void increment_write_idx (size_t cnt)
 
size_t write_space () const
 
size_t read_space () const
 
T * buffer ()
 
size_t get_write_idx () const
 
size_t get_read_idx () const
 
size_t bufsize () const
 

Protected Attributes

T * buf
 
size_t size
 
size_t size_mask
 
std::atomic< int > write_idx
 
std::atomic< int > read_idx
 

Private Member Functions

 RingBuffer (RingBuffer const &)
 

Detailed Description

template<class T>
class PBD::RingBuffer< T >

Definition at line 33 of file ringbuffer.h.

Constructor & Destructor Documentation

◆ RingBuffer() [1/2]

template<class T >
PBD::RingBuffer< T >::RingBuffer ( size_t  sz)
inline

Definition at line 36 of file ringbuffer.h.

◆ ~RingBuffer()

template<class T >
virtual PBD::RingBuffer< T >::~RingBuffer ( )
inlinevirtual

Definition at line 49 of file ringbuffer.h.

◆ RingBuffer() [2/2]

template<class T >
PBD::RingBuffer< T >::RingBuffer ( RingBuffer< T > const &  )
private

Member Function Documentation

◆ buffer()

template<class T >
T* PBD::RingBuffer< T >::buffer ( )
inline

Definition at line 116 of file ringbuffer.h.

◆ bufsize()

template<class T >
size_t PBD::RingBuffer< T >::bufsize ( ) const
inline

Definition at line 119 of file ringbuffer.h.

◆ decrement_read_idx()

template<class T >
void PBD::RingBuffer< T >::decrement_read_idx ( size_t  cnt)
inline

Definition at line 76 of file ringbuffer.h.

◆ get_read_idx()

template<class T >
size_t PBD::RingBuffer< T >::get_read_idx ( ) const
inline

Definition at line 118 of file ringbuffer.h.

◆ get_read_vector()

template<class T >
void PBD::RingBuffer< T >::get_read_vector ( rw_vector )

Definition at line 212 of file ringbuffer.h.

◆ get_write_idx()

template<class T >
size_t PBD::RingBuffer< T >::get_write_idx ( ) const
inline

Definition at line 117 of file ringbuffer.h.

◆ get_write_vector()

template<class T >
void PBD::RingBuffer< T >::get_write_vector ( rw_vector )

Definition at line 253 of file ringbuffer.h.

◆ increment_read_idx()

template<class T >
void PBD::RingBuffer< T >::increment_read_idx ( size_t  cnt)
inline

Definition at line 80 of file ringbuffer.h.

◆ increment_write_idx()

template<class T >
void PBD::RingBuffer< T >::increment_write_idx ( size_t  cnt)
inline

Definition at line 84 of file ringbuffer.h.

◆ read()

template<class T >
size_t PBD::RingBuffer< T >::read ( T *  dest,
size_t  cnt 
)

Definition at line 133 of file ringbuffer.h.

◆ read_space()

template<class T >
size_t PBD::RingBuffer< T >::read_space ( ) const
inline

Definition at line 103 of file ringbuffer.h.

◆ reset()

template<class T >
void PBD::RingBuffer< T >::reset ( )
inline

Definition at line 53 of file ringbuffer.h.

◆ set()

template<class T >
void PBD::RingBuffer< T >::set ( size_t  r,
size_t  w 
)
inline

Definition at line 59 of file ringbuffer.h.

◆ write()

template<class T >
size_t PBD::RingBuffer< T >::write ( T const *  src,
size_t  cnt 
)

Definition at line 172 of file ringbuffer.h.

◆ write_space()

template<class T >
size_t PBD::RingBuffer< T >::write_space ( ) const
inline

Definition at line 88 of file ringbuffer.h.

Member Data Documentation

◆ buf

template<class T >
T* PBD::RingBuffer< T >::buf
protected

Definition at line 122 of file ringbuffer.h.

◆ read_idx

template<class T >
std::atomic<int> PBD::RingBuffer< T >::read_idx
mutableprotected

Definition at line 126 of file ringbuffer.h.

◆ size

template<class T >
size_t PBD::RingBuffer< T >::size
protected

Definition at line 123 of file ringbuffer.h.

◆ size_mask

template<class T >
size_t PBD::RingBuffer< T >::size_mask
protected

Definition at line 124 of file ringbuffer.h.

◆ write_idx

template<class T >
std::atomic<int> PBD::RingBuffer< T >::write_idx
mutableprotected

Definition at line 125 of file ringbuffer.h.


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