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

Base class for all media buffers. More...

#include <MpBuf.h>

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

Public Member Functions

Manipulators
void attach ()
 Increments reference counter. More...
 
void detach ()
 Decrements reference counter and free buffer if needed. More...
 
Accessors
void setFlowGraph (MpFlowGraphBase *flowgraph)
 
MP_BUFFERS_TREE getType () const
 Get buffer type. More...
 
MpBufPoolgetBufferPool () const
 Get parent pool of this buffer. More...
 

Static Protected Member Functions

static void sInitClone (MpBuf *pBuffer)
 Function that initialize buffer after cloning. It adjusts reference counters. More...
 

Protected Attributes

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

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

Friends

class MpBufPtr
 
class MpBufPool
 

Detailed Description

Base class for all media buffers.

This class designed to be used with memory pool MpBufPool and smart pointer MpBufPoolPtr. It seems to be useless without them.

This struct itself does not provide any data storage. It contain only reference counter and pointer to parent pool. To store data in this pool use MpArrayBuf. To store store data in the other pool use MpDataBuf or one of its children.

Constructor & Destructor Documentation

MpBuf ( const MpBuf )
private

Disable copy (and other) constructor.

This struct will be initialized by init() member.

Member Function Documentation

void attach ( )

Increments reference counter.

void detach ( )

Decrements reference counter and free buffer if needed.

void setFlowGraph ( MpFlowGraphBase flowgraph)
inline
MP_BUFFERS_TREE getType ( ) const
inline

Get buffer type.

MpBufPool* getBufferPool ( ) const
inline

Get parent pool of this buffer.

void sInitClone ( MpBuf pBuffer)
staticprotected

Function that initialize buffer after cloning. It adjusts reference counters.

MpBuf& operator= ( const MpBuf )
private

Disable assignment operator.

Buffers may be copied. But do we need this?

Friends And Related Function Documentation

friend class MpBufPtr
friend
friend class MpBufPool
friend

Member Data Documentation

MP_BUFFERS_TREE mType
protected

Buffer class type. Used for type safety.

int mRefCounter
protected

Reference counter for use with MpBufPtr.

MpBufPool* mpPool
protected

Parent memory pool.

MpFlowGraphBase* mpFlowGraph
protected

Debug pointer to flowgraph in which this buf is used.

void(* mpDestroy) (MpBuf *)
protected

Pointer to deinitialization method. Used as virtual destructor.

void(* mpInitClone) (MpBuf *)
protected

Pointer to function that initialize buffer after cloning.