Public Member Functions | |
ReferenceCounted () | |
Constructor. | |
virtual | ~ReferenceCounted () |
Deconstructor. | |
virtual void | grab () |
Increases the reference counter. | |
virtual void | drop () |
Decreases the reference counter. | |
s32 | getReferenceCount () |
Gets the reference count. |
When you create an object within the framework, calling a method which starts with 'create', an object is created, and you get a pointer to the new object. If you no longer need the object, you have to call drop(). This will destroy the object, if grab() was not called in another part of you program, because this part still needs the object. Note, that you only need to call drop() to the object, if you created it, and the method had a 'create' in it.
Definition at line 36 of file ReferenceCounted.h.
ReferenceCounted::ReferenceCounted | ( | ) |
ReferenceCounted::~ReferenceCounted | ( | ) | [virtual] |
void ReferenceCounted::drop | ( | ) | [virtual] |
Decreases the reference counter.
Reimplemented in AssetManager, DataStore, EntityManager, EventManager, GameManager, ScriptManager, and SoundManager.
Definition at line 48 of file ReferenceCounted.cpp.
s32 ReferenceCounted::getReferenceCount | ( | ) |
void ReferenceCounted::grab | ( | ) | [virtual] |
Increases the reference counter.
Reimplemented in AssetManager, DataStore, EntityManager, EventManager, GameManager, ScriptManager, and SoundManager.
Definition at line 42 of file ReferenceCounted.cpp.