AudibleT 0.0.1
A real-time A/B/X audio testing tool for subjective assessment of various audio parameters, compatible for general purpose computer as well as embedded systems.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
JackCpp::RingBuffer< Type > Class Template Reference

Public Member Functions

 RingBuffer (size_t size, bool mlock=false)
 The Constructor.
 
 ~RingBuffer ()
 The Destructor.
 
size_t length ()
 Get the total length of the ring buffer.
 
bool isBufferMemoryLocked ()
 Get whether the ring buffer is locked into the memory.
 
size_t getReadSpace ()
 Get the number of items that can be read at this time.
 
size_t getWriteSpace ()
 Get the number of items that can be written at this time.
 
void read (Type &dest)
 Read into dest.
 
void read (Type *dest, unsigned cnt)
 Read into an array.
 
void write (Type src)
 Write into the ring buffer.
 
void write (Type *src, unsigned int cnt)
 Write an array of values into the ring buffer.
 
void reset ()
 Reset.
 

Constructor & Destructor Documentation

◆ RingBuffer()

template<typename Type >
JackCpp::RingBuffer< Type >::RingBuffer ( size_t  size,
bool  mlock = false 
)
inline

The Constructor.

Parameters
sizethe number of items that the ring buffer should be able to hold
mlocka boolean indicating whether or not the ring buffer should be locked in memory

Member Function Documentation

◆ read() [1/2]

template<typename Type >
void JackCpp::RingBuffer< Type >::read ( Type &  dest)
inline

Read into dest.

Read from the buffer into a variable.

Parameters
destan item to be read into

◆ read() [2/2]

template<typename Type >
void JackCpp::RingBuffer< Type >::read ( Type *  dest,
unsigned  cnt 
)
inline

Read into an array.

Read from the buffer into an array.

Parameters
destan array to be read into
cntthe number of elements to read into this array

◆ reset()

template<typename Type >
void JackCpp::RingBuffer< Type >::reset ( )
inline

Reset.

This is not threadsafe. This resets the read and write pointers, effectively making the ring buffer empty.

◆ write() [1/2]

template<typename Type >
void JackCpp::RingBuffer< Type >::write ( Type *  src,
unsigned int  cnt 
)
inline

Write an array of values into the ring buffer.

Parameters
srcan array of values to write
cntthe number of items from the array to write into our buffer

◆ write() [2/2]

template<typename Type >
void JackCpp::RingBuffer< Type >::write ( Type  src)
inline

Write into the ring buffer.

Parameters
srcthe value to write

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