Skip to content
SiteEmail

cohtml::DataBuffer

A reference counted data buffer.

#include <Library.h>

Name
typedef void(*)(unsigned char *data, void *userData)CallbackOnDestruction
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.
Name
virtual~DataBuffer()
typedef void(* cohtml::DataBuffer::CallbackOnDestruction) (unsigned char *data, void *userData);
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

virtual unsigned char * GetData() const =0
virtual size_t GetSize() const =0
virtual void Release() =0

Releases the currently held reference.

Note: CallbackOnDestruction will be called when all references are released

virtual ~DataBuffer()