Berserk
|
Generic shared byte data storage. More...
#include <Data.hpp>
Public Types | |
using | ReleaseProc = std::function< void(void *)> |
Public Member Functions | |
BRK_API | ~Data () override |
const void * | GetData () const |
void * | GetDataWrite () |
size_t | GetSize () const |
bool | IsMutable () const |
void | MarkImmutable () |
![]() | |
virtual | ~RefCnt () |
bool | IsUnique () const |
std::int32_t | GetRefs () const |
std::int32_t | AddRef () const |
std::int32_t | RelRef () const |
Static Public Member Functions | |
static BRK_API Ref< Data > | Make (const void *data, size_t sizeInBytes) |
static BRK_API Ref< Data > | Make (const String &string) |
static BRK_API Ref< Data > | Make (size_t sizeInBytes) |
Protected Member Functions | |
Data (size_t size, void *ptr, ReleaseProc releaseProc, bool isMutable) | |
![]() | |
virtual void | Destroy () const |
Generic shared byte data storage.
using Data::ReleaseProc = std::function<void(void *)> |
|
override |
|
protected |
[Internal Usage] Creates data instance
|
inline |
|
inline |
|
inline |
|
inline |
Makes new data from string characters. Uses system malloc for internal data storage allocation.
string | String to make data from |
Makes new data from provided data buffer. Uses system malloc for internal data storage allocation.
data | Pointer to data to copy into buffer |
sizeInBytes | Size in bytes of the buffer |
Makes new data with specified size. Use get data function to retrieve writable memory pointer. Uses system malloc for internal data storage allocation.
sizeInBytes | Size in bytes of the data buffer |
|
inline |
Lock data for mutation. Now it is immutable.