Drag[en]gine Game Engine
1.21
|
Basic object interface. More...
#include <deObject.h>
Public Types | |
typedef deTObjectReference< deObject > | Ref |
Type holding strong reference. More... | |
Public Member Functions | |
Management | |
int | GetRefCount () const |
Reference count. More... | |
void | AddReference () |
Add reference increasing reference count by 1. More... | |
void | FreeReference () |
Decrease reference count by one and delete object if count reaches 0. More... | |
Constructors and Destructors | |
deObject () | |
Create object with reference count of 1. More... | |
virtual | ~deObject () |
Clean up object. More... | |
Basic object interface.
Provides the basic class for all engine objects. Each object has a reference count. Objects stay alive as long as the reference count is larger than 0. If you want to add a reference use the AddReference function. If you want to free the reference you have added before use the FreeReference function and do not call 'delete'. Upon creation each object is assigned a reference count of 1 so you do not have to add a refernece after creating an object.
typedef deTObjectReference<deObject> deObject::Ref |
Type holding strong reference.
deObject::deObject | ( | ) |
Create object with reference count of 1.
|
protectedvirtual |
Clean up object.
void deObject::AddReference | ( | ) |
Add reference increasing reference count by 1.
void deObject::FreeReference | ( | ) |
Decrease reference count by one and delete object if count reaches 0.
|
inline |
Reference count.