#include <Blob.h>
Inheritance diagram for util::Blob< T >:

As a template, Blob can store pointers to any type of data.
Public Methods | |
| Blob (T *ptr=NULL, int len=0, bool release=false, bool array=false) | |
| Create a new Blob. | |
| Blob (const Blob &other) | |
| Copy a Blob. | |
| ~Blob () | |
| Destroy a Blob. | |
| Blob & | operator= (const Blob &other) |
| Copy a blob. | |
| bool | operator== (const Blob &other) const |
| Returns true if and only if the two blobs point to the same memory location. | |
| const T * | getData () const |
| Get a pointer to the internal data. | |
| void | setData (T *data) |
| Set the internal data pointer. | |
| T * | getData () |
| Get a pointer to the internal data. | |
| int | getLength () const |
| Get the size of the data. | |
| T * | release () |
| Release the data. | |
| bool | isOwner () const |
| Check the release flag. | |
| void | setOwner (bool release) |
| Set the ownership of the internal pointer. | |
| bool | isArray () const |
| Check whether the internal pointer is an array. | |
| void | setArray (bool array) |
| Set the type of the internal pointer. | |
|
||||||||||||||||||||||||
|
Create a new Blob.
|
|
||||||||||
|
Copy a Blob. The memory pointed by the pointer in other is not copied. Instead, the two Blobs now reference the same memory location. |
|
|||||||||
|
Check whether the internal pointer is an array. If it is, delete[] is used instead of delete when destroying the pointer. |
|
|||||||||
|
Check the release flag. If release is true, this blob is the "owner" of its internal pointer. |
|
||||||||||
|
Copy a blob. If the release flag is true, the memory pointer is deleted. Upon copying, the release flag is always set to false to ensure no data is deleted multiple times. |
|
|||||||||
|
Release the data. The release flag is set to false, and the internal pointer is returned. |
|
||||||||||
|
Set the type of the internal pointer.
|
|
||||||||||
|
Set the internal data pointer. If the release flag is true, the old data is deleted. |
|
||||||||||
|
Set the ownership of the internal pointer.
|