sipxmedialib  Version 3.3
List of all members
MpDataBufPtr Class Reference

Smart pointer to MpDataBuf. More...

#include <MpDataBuf.h>

Inheritance diagram for MpDataBufPtr:
Inheritance graph
[legend]
Collaboration diagram for MpDataBufPtr:
Collaboration graph
[legend]

Public Member Functions

Creators
 MpDataBufPtr (MpBuf *pDataBuffer, MpBufPool *pHeaderPool=MpDataBuf::smpDefaultPool)
 Default constructor - construct invalid pointer. More...
 
Accessors
void setFlowGraph (MpFlowGraphBase *flowgraph)
 
- Public Member Functions inherited from MpBufPtr
 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
 
MpBufPtroperator= (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...
 
int getBufferNumber () const
 Return number of the buffer in the pool. Use this for debug output. More...
 
void setFlowGraph (MpFlowGraphBase *flowgraph)
 
MpBufoperator-> ()
 Return pointer to MpBuf. More...
 
const MpBufoperator-> () const
 Return readonly pointer to MpBuf. More...
 
MP_BUFFERS_TREE getType () const
 
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...
 

Additional Inherited Members

- Protected Attributes inherited from MpBufPtr
MpBufmpBuffer
 Pointer to real buffer. More...
 

Detailed Description

Smart pointer to MpDataBuf.

You should only use this smart pointer, not MpDataBuf* itself. The goal of this smart pointer is to care about reference counter and buffer deallocation.

Constructor & Destructor Documentation

MpDataBufPtr ( MpBuf pDataBuffer,
MpBufPool pHeaderPool = MpDataBuf::smpDefaultPool 
)
inline

Default constructor - construct invalid pointer.

This constructor owns MpBuf object.

Member Function Documentation

void setFlowGraph ( MpFlowGraphBase flowgraph)
inline