sipxmedialib
Version 3.3
|
Smart pointer to MpBuf. More...
#include <MpBuf.h>
Public Member Functions | |
Creators | |
MpBufPtr () | |
Default constructor - construct invalid pointer. More... | |
MpBufPtr (MpBuf *buffer) | |
This constructor owns MpBuf object. More... | |
~MpBufPtr () | |
Destructor. It decrements buffer's reference counter. More... | |
MpBufPtr (const MpBufPtr &buffer) | |
Copy buffer pointer and increment its reference counter. More... | |
MpBufPtr | clone () const |
Manipulators | |
MpBufPtr & | operator= (const MpBufPtr &bufferPtr) |
Smart assignment. More... | |
bool | operator== (const MpBufPtr &pBuffer) |
Compare two smart pointers. More... | |
bool | operator!= (const MpBufPtr &pBuffer) |
Compare two smart pointers. More... | |
void | release () |
Release buffer we are pointing to. More... | |
void | swap (MpBufPtr &pBuffer) |
Swap to buffers. More... | |
bool | requestWrite () |
Check if buffer is writable and create copy if no. More... | |
Accessors | |
int | getBufferNumber () const |
Return number of the buffer in the pool. Use this for debug output. More... | |
void | setFlowGraph (MpFlowGraphBase *flowgraph) |
MpBuf * | operator-> () |
Return pointer to MpBuf. More... | |
const MpBuf * | operator-> () const |
Return readonly pointer to MpBuf. More... | |
MP_BUFFERS_TREE | getType () const |
Inquiry | |
bool | isValid () const |
Can this pointer be dereferenced? Use this function instead of NULL comparison. More... | |
bool | isWritable () |
You should write to the buffer if and only if this function return true. More... | |
Protected Attributes | |
MpBuf * | mpBuffer |
Pointer to real buffer. More... | |
Friends | |
class | MpBufPool |
struct | MpDataBuf |
Smart pointer to MpBuf.
You should only use this smart pointer, not MpBuf* itself. The goal of this smart pointer is to care about reference counter and buffer deallocation.
|
inline |
Default constructor - construct invalid pointer.
This constructor owns MpBuf object.
|
inline |
Destructor. It decrements buffer's reference counter.
|
inline |
Smart assignment.
Decrement reference counter of our old buffer and increment in new one.
|
inline |
Compare two smart pointers.
Two pointers assumed equal if they point to the same buffer.
|
inline |
Compare two smart pointers.
Two pointers assumed equal if they point to the same buffer.
|
inline |
Release buffer we are pointing to.
If no one else is pointing to this buffer it will be freed.
|
inline |
Swap to buffers.
This pointer will point to buffer pointed by pBuffer, and pBuffer will point to buffer, pointed by this pointer. Swap does not modify reference counters of buffers.
|
inline |
Check if buffer is writable and create copy if no.
|
inline |
Return number of the buffer in the pool. Use this for debug output.
|
inline |
|
inline |
|
inline |
Can this pointer be dereferenced? Use this function instead of NULL comparison.
|
inline |
You should write to the buffer if and only if this function return true.
isWritable() check are you the only owner of this buffer.
|
friend |
|
friend |
|
protected |
Pointer to real buffer.