52 DestroyBufferCallback destruction_callback);
67 virtual size_t size()
const = 0;
#define UExport
Definition Exports.h:25
A fixed-size container for raw byte data.
Definition Buffer.h:32
virtual void * user_data()=0
Get the user data associated with this Buffer, if any.
virtual bool owns_data() const =0
Check whether this Buffer owns its own data (Buffer was created via CreateFromCopy).
static RefPtr< Buffer > Create(void *data, size_t size, void *user_data, DestroyBufferCallback destruction_callback)
Create a Buffer from existing, user-owned data without any copies.
void operator=(const Buffer &)
virtual size_t size() const =0
Get the size in bytes.
virtual void * data()=0
Get a pointer to the raw byte data.
static RefPtr< Buffer > CreateFromCopy(const void *data, size_t size)
Create a Buffer from existing data, a deep copy of data will be made.
Interface for all ref-counted objects that will be managed using the RefPtr<> smart pointer.
Definition RefPtr.h:47
A nullable smart pointer.
Definition RefPtr.h:79
void(* DestroyBufferCallback)(void *user_data, void *data)
Function signature for a user-defined destruction callback to optionally be called when Buffer is des...
Definition Buffer.h:23