MPD  0.20.18
Public Member Functions
PcmBuffer Class Reference

Manager for a temporary buffer which grows as needed. More...

#include <PcmBuffer.hxx>

Public Member Functions

void Clear ()
 
gcc_malloc void * Get (size_t size)
 Get the buffer, and guarantee a minimum size. More...
 
template<typename T >
gcc_malloc T * GetT (size_t n)
 

Detailed Description

Manager for a temporary buffer which grows as needed.

We could allocate a new buffer every time pcm_convert() is called, but that would put too much stress on the allocator.

Definition at line 33 of file PcmBuffer.hxx.

Member Function Documentation

◆ Clear()

void PcmBuffer::Clear ( )
inline

Definition at line 37 of file PcmBuffer.hxx.

◆ Get()

gcc_malloc void* PcmBuffer::Get ( size_t  size)

Get the buffer, and guarantee a minimum size.

This buffer becomes invalid with the next Get() call.

This function will never return nullptr, even if size is zero, because the PCM library uses the nullptr return value to signal "error". An empty destination buffer is not always an error.

◆ GetT()

template<typename T >
gcc_malloc T* PcmBuffer::GetT ( size_t  n)
inline

Definition at line 55 of file PcmBuffer.hxx.


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