sipxmedialib  Version 3.3
Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
MpDataBuf Struct Reference

Stores data in the external buffer. More...

#include <MpDataBuf.h>

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

Public Member Functions

Manipulators
void setData (const MpArrayBufPtr &pData)
 Set new payload data. More...
 
Accessors
char * getDataWritePtr ()
 Return pointer to payload data. More...
 
const char * getDataPtr () const
 Return pointer to payload data. More...
 
MpArrayBufPtr getData () const
 Get payload data. More...
 
- Public Member Functions inherited from MpBuf
void attach ()
 Increments reference counter. More...
 
void detach ()
 Decrements reference counter and free buffer if needed. More...
 
void setFlowGraph (MpFlowGraphBase *flowgraph)
 
MP_BUFFERS_TREE getType () const
 Get buffer type. More...
 
MpBufPoolgetBufferPool () const
 Get parent pool of this buffer. More...
 

Static Public Attributes

static MpBufPoolsmpDefaultPool = NULL
 Default pool for MpDataBuf objects. More...
 

Protected Member Functions

void init ()
 This is called in place of constructor. More...
 

Static Protected Member Functions

static void sDestroy (MpBuf *pBuffer)
 Destructor for MpDataBuf. More...
 
static void sInitClone (MpBuf *pBuffer)
 Function that initialize buffer after cloning. It makes clone of mpData. More...
 
- Static Protected Member Functions inherited from MpBuf
static void sInitClone (MpBuf *pBuffer)
 Function that initialize buffer after cloning. It adjusts reference counters. More...
 

Protected Attributes

MpArrayBufPtr mpData
 Payload data. More...
 
- Protected Attributes inherited from MpBuf
MP_BUFFERS_TREE mType
 Buffer class type. Used for type safety. More...
 
int mRefCounter
 Reference counter for use with MpBufPtr. More...
 
MpBufPoolmpPool
 Parent memory pool. More...
 
MpFlowGraphBasempFlowGraph
 Debug pointer to flowgraph in which this buf is used. More...
 
void(* mpDestroy )(MpBuf *)
 
void(* mpInitClone )(MpBuf *)
 

Private Member Functions

 MpDataBuf (const MpBuf &)
 Disable copy (and other) constructor. More...
 
MpDataBufoperator= (const MpBuf &)
 Disable assignment operator. More...
 

Friends

class MpDataBufPtr
 

Detailed Description

Stores data in the external buffer.

This struct could be used if you want to store data separate from header. This approach may be useful when you need to share data between several headers. For example, you may want to pass raw audio data to RTP packet without copying.

Warning
Data pointer is set in the MpDataBufPtr constructor.

Constructor & Destructor Documentation

MpDataBuf ( const MpBuf )
private

Disable copy (and other) constructor.

This struct will be initialized by init() member.

Member Function Documentation

void setData ( const MpArrayBufPtr pData)
inline

Set new payload data.

char * getDataWritePtr ( )

Return pointer to payload data.

const char * getDataPtr ( ) const

Return pointer to payload data.

MpArrayBufPtr getData ( ) const
inline

Get payload data.

void init ( )
protected

This is called in place of constructor.

void sDestroy ( MpBuf pBuffer)
staticprotected

Destructor for MpDataBuf.

void sInitClone ( MpBuf pBuffer)
staticprotected

Function that initialize buffer after cloning. It makes clone of mpData.

MpDataBuf& operator= ( const MpBuf )
private

Disable assignment operator.

Buffers may be copied. But do we need this?

Friends And Related Function Documentation

friend class MpDataBufPtr
friend

Member Data Documentation

MpBufPool * smpDefaultPool = NULL
static

Default pool for MpDataBuf objects.

MpArrayBufPtr mpData
protected

Payload data.