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::ManagedDataWrapper< TData > Class Template Reference

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.
 

Detailed Description

template<class TData>
class Menge::ManagedDataWrapper< TData >

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.

Constructor & Destructor Documentation

template<class TData>
Menge::ManagedDataWrapper< TData >::ManagedDataWrapper ( TData *  data)
inline

Constructor.

All classes which must call this constructor in their own constructors. See Image::Image for an example.

Parameters
dataA pointer to an instance of ManagedData.

Member Function Documentation

template<class TData>
void Menge::ManagedDataWrapper< TData >::freeData ( )
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.


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