Menge
Modular Pedestrian Simulation Framework for Research and Development
|
A wrapper for managed data - automatically handles referencing and deletion of managed data. More...
#include <ManagedData.h>
Public Member Functions | |
ManagedDataWrapper (TData *data) | |
Constructor. More... | |
void | freeData () |
Technically, decrements the data's reference count and garbage collects it when necessary. More... | |
Protected Attributes | |
TData * | _data |
The managed data for this wrapper. | |
A wrapper for managed data - automatically handles referencing and deletion of managed data.
Any class that uses managed data directly (i.e., a class derived from ManagedData) should sub-class the ManagedData wrapper and implement its interface. The wrapper will automatically take care of reference counts.
|
inline |
Constructor.
All classes which must call this constructor in their own constructors. See Image::Image for an example.
data | A pointer to an instance of ManagedData. |
|
inline |
Technically, decrements the data's reference count and garbage collects it when necessary.
Sub-classes of ManagedDataWrapper should call this in their destructor after destorying all the rest of their memory. See Image::~Image for an example.