MeVisLab Toolbox Reference
|
The strong handle of a MLMemoryBlock. More...
#include <mlMemoryBlockHandle.h>
Public Member Functions | |
MLMemoryBlockHandle () | |
Creates a memory block handle that is null. | |
MLMemoryBlockHandle (const MLMemoryBlockHandle &memoryBlockHandle) | |
Creates an additional memory block handle to the memory block of memoryBlockHandle. | |
MLMemoryBlockHandle (const MLWeakMemoryBlockHandle &weakMemoryBlockHandle) | |
Creates an memory block handle to the memory block of weakMemoryBlockHandle. | |
~MLMemoryBlockHandle () | |
If only weak handles to the memory block exist, then the memory block is added to the cache list. | |
bool | isNull () const |
Returns true if the handle does not reference a valid memory block. | |
void * | data () const |
Returns the data of the memory block. If this handle is null, then NULL is returned. | |
size_t | size () const |
Returns the size of the data. If this handle is null, then 0 is returned. | |
void | clear () |
Releases the reference to the memory block. | |
MLMemoryBlockHandle & | operator= (const MLMemoryBlockHandle &memoryBlockHandle) |
Creates a memory block handle from the memory block handle. | |
MLMemoryBlockHandle & | operator= (const MLWeakMemoryBlockHandle &weakMemoryBlockHandle) |
Creates a memory block handle from the weak memory block handle. | |
The strong handle of a MLMemoryBlock.
It is the only way to access the memory block data. Internally it manages whether the memory block is contained in the cache list, or if is locked memory. The memory block is passed to the handle either by the allocation methods of the MLMemoryManager, or by the assignment from a MLWeakMemoryBlockHandle.
Definition at line 38 of file mlMemoryBlockHandle.h.
MLMemoryBlockHandle::MLMemoryBlockHandle | ( | ) |
Creates a memory block handle that is null.
MLMemoryBlockHandle::MLMemoryBlockHandle | ( | const MLMemoryBlockHandle & | memoryBlockHandle | ) |
Creates an additional memory block handle to the memory block of memoryBlockHandle.
The memory block of memoryBlockHandle may be null.
MLMemoryBlockHandle::MLMemoryBlockHandle | ( | const MLWeakMemoryBlockHandle & | weakMemoryBlockHandle | ) |
Creates an memory block handle to the memory block of weakMemoryBlockHandle.
The memory block may already have been destroyed, so check if it is null after the assigment.
MLMemoryBlockHandle::~MLMemoryBlockHandle | ( | ) |
If only weak handles to the memory block exist, then the memory block is added to the cache list.
If neither weak handles or strong handles
void MLMemoryBlockHandle::clear | ( | ) |
Releases the reference to the memory block.
The memory block handle is null afterwards.
void * MLMemoryBlockHandle::data | ( | ) | const |
Returns the data of the memory block. If this handle is null, then NULL is returned.
Referenced by ml::SubImage::setDataFromMemoryBlockHandle().
bool MLMemoryBlockHandle::isNull | ( | ) | const |
Returns true if the handle does not reference a valid memory block.
For example, it can be null if the memory block has been already deleted from cache. true is also returned if the data of the memory block is NULL.
size_t MLMemoryBlockHandle::size | ( | ) | const |
Returns the size of the data. If this handle is null, then 0 is returned.