Menge
Modular Pedestrian Simulation Framework for Research and Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
Menge::ManagedData Class Reference

The interface for managed data (essentially smart poitners). More...

#include <ManagedData.h>

Inheritance diagram for Menge::ManagedData:
Menge::ImageData

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.
 

Detailed Description

The interface for managed data (essentially smart poitners).

Constructor & Destructor Documentation

virtual Menge::ManagedData::~ManagedData ( )
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.

Member Function Documentation

int Menge::ManagedData::decRef ( )
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.

Returns
The number of remaining references.
int Menge::ManagedData::incRef ( )
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.

Returns
The total number of references.
bool Menge::ManagedData::isUnreferenced ( ) const
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.

Returns
True if the underlying managed data is no longer referenced, false otherwise.

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