MeVisLabToolboxReference
ml::ManagedSubImage Class Reference

ManagedSubImage is derived from SubImage and frees its allocated memory automatically when it is destructed. More...

#include <mlManagedSubImage.h>

Inheritance diagram for ml::ManagedSubImage:
ml::SubImage

List of all members.

Public Member Functions

 ManagedSubImage ()
 Constructor.
ManagedSubImageoperator= (const SubImage &si)
 Copy operator from SubImage.
virtual ~ManagedSubImage ()
 Destruct the object, freeing the memory.
void * takeData ()
 Returns the data pointer and set the internal data to NULL (so it passes the ownership of the data to the caller) NOTE: This should only be used on images that where allocated via MLAlloc or with user provided memory.

Detailed Description

ManagedSubImage is derived from SubImage and frees its allocated memory automatically when it is destructed.

If you make use of TileRequest::AllocationPolicy == TileRequest::ExternalBuffer, make sure that you call takeData(), otherwise this class will delete your external buffer in its destructor!

The class is not exported to make inlining possible.

Definition at line 29 of file mlManagedSubImage.h.


Constructor & Destructor Documentation

ml::ManagedSubImage::ManagedSubImage ( ) [inline]

Constructor.

Definition at line 34 of file mlManagedSubImage.h.

virtual ml::ManagedSubImage::~ManagedSubImage ( ) [inline, virtual]

Destruct the object, freeing the memory.

Definition at line 43 of file mlManagedSubImage.h.


Member Function Documentation

ManagedSubImage& ml::ManagedSubImage::operator= ( const SubImage si) [inline]

Copy operator from SubImage.

Reimplemented from ml::SubImage.

Definition at line 37 of file mlManagedSubImage.h.

void* ml::ManagedSubImage::takeData ( ) [inline]

Returns the data pointer and set the internal data to NULL (so it passes the ownership of the data to the caller) NOTE: This should only be used on images that where allocated via MLAlloc or with user provided memory.

It will not work correctly on MemoryManager allocated memory, since one has to use getMemoryBlockHandle() instead to get the data.

Definition at line 51 of file mlManagedSubImage.h.


The documentation for this class was generated from the following file: