Menge
Modular Pedestrian Simulation Framework for Research and Development
|
The interface for managed data (essentially smart poitners). More...
#include <ManagedData.h>
Public Member Functions | |
ManagedData () | |
Constructor. | |
virtual | ~ManagedData () |
Virtual destructor. More... | |
int | incRef () |
Increment references to the managed data. More... | |
int | decRef () |
Decrement references to the managed data. More... | |
bool | isUnreferenced () const |
Reports if the data is referenced. More... | |
Protected Attributes | |
int | _refCount |
The number of data wrappers using this managed data. | |
The interface for managed data (essentially smart poitners).
|
inlinevirtual |
Virtual destructor.
Sub-classes of ManagedData, upon their destruction, must remove themselves from the resource set. It does this by performing a call to removeResource with appropriate template values and parameters. See ImageData::~ImageData as an example.
|
inline |
Decrement references to the managed data.
Any object that carries a pointer to managed data should call this function upon destruction (thereby removing its reference from the managed data's reference count.
|
inline |
Increment references to the managed data.
Any object that carries a pointer to managed data should call this function when acquiring and storing a pointer to that data.
|
inline |
Reports if the data is referenced.
Any object that carries a pointer to managed data, after dereferencing itself upon destruction, should determine if it is no longer referenced and delete the object if this function returns true. NOTE: this is not thread-safe.