cohtml::DataBuffer

A reference counted data buffer.

#include <Library.h>

Public Types

Name
typedef void(*)(unsigned char *data, void *userData)CallbackOnDestruction

Public Functions

Name
DataBuffer *CreateDataBuffer(unsigned char * data, size_t size, CallbackOnDestruction callback, void * userData)
Constructs new object from provided data, size and callback.
virtual unsigned char *GetData() const =0
virtual size_tGetSize() const =0
virtual voidRelease() =0
Releases the currently held reference.

Protected Functions

Name
virtual~DataBuffer()

Public Types Documentation

typedef CallbackOnDestruction

typedef void(* cohtml::DataBuffer::CallbackOnDestruction) (unsigned char *data, void *userData);

Public Functions Documentation

function CreateDataBuffer

static DataBuffer * CreateDataBuffer(
    unsigned char * data,
    size_t size,
    CallbackOnDestruction callback,
    void * userData
)

Constructs new object from provided data, size and callback.

Note: Data is adopted, but the memory is not copied, you should let this buffer free the memory via the provided destruction callback

function GetData

virtual unsigned char * GetData() const =0

function GetSize

virtual size_t GetSize() const =0

function Release

virtual void Release() =0

Releases the currently held reference.

Note: CallbackOnDestruction will be called when all references are released

Protected Functions Documentation

function ~DataBuffer

virtual ~DataBuffer()