Logo Search packages:      
Sourcecode: rosegarden version File versions  Download package

Rosegarden::RingBuffer< T, N > Class Template Reference

#include <RingBuffer.h>

List of all members.

Detailed Description

template<typename T, int N = 1>
class Rosegarden::RingBuffer< T, N >

RingBuffer implements a lock-free ring buffer for one writer and N readers, that is to be used to store a sample type T.

For efficiency, RingBuffer frequently initialises samples by writing zeroes into their memory space, so T should normally be a simple type that can safely be set to zero using memset.

Definition at line 48 of file RingBuffer.h.

Public Member Functions

size_t getReadSpace (int R=0) const
size_t getSize () const
size_t getWriteSpace () const
bool mlock ()
bool munlock ()
peek (int R=0) const
size_t peek (T *destination, size_t n, int R=0) const
size_t read (T *destination, size_t n, int R=0)
size_t readAdding (T *destination, size_t n, int R=0)
readOne (int R=0)
void reset ()
void resize (size_t newSize)
 RingBuffer (size_t n)
size_t skip (size_t n, int R=0)
size_t write (const T *source, size_t n)
size_t zero (size_t n)

Protected Attributes

T * m_buffer
bool m_mlocked
volatile size_t m_readers [N]
size_t m_size
volatile size_t m_writer

Static Protected Attributes

static Scavenger
< ScavengerArrayWrapper< T > > 

Private Member Functions

RingBufferoperator= (const RingBuffer &)
 RingBuffer (const RingBuffer &)

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

Generated by  Doxygen 1.6.0   Back to index