ReferenceCounted Class Reference

This class provides reference counting through the methods grab() and drop(). Most objects with the framework are derived from ReferenceCounted, and so they are reference counted. More...

Inheritance diagram for ReferenceCounted:

Inheritance graph
[legend]

List of all members.

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.


Detailed Description

This class provides reference counting through the methods grab() and drop(). Most objects with the framework are derived from ReferenceCounted, and so they are reference counted.

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.

Note:
Adapted from the Irrlicht API documentation.

Definition at line 36 of file ReferenceCounted.h.


Constructor & Destructor Documentation

ReferenceCounted::ReferenceCounted (  ) 

Constructor.

Definition at line 25 of file ReferenceCounted.cpp.

ReferenceCounted::~ReferenceCounted (  )  [virtual]

Deconstructor.

Definition at line 31 of file ReferenceCounted.cpp.


Member Function Documentation

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 (  ) 

Gets the reference count.

Definition at line 36 of file ReferenceCounted.cpp.

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.


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

Generated on Fri Aug 21 23:55:16 2009 for Sirrf - Simple Irrlicht Framework by  doxygen 1.5.8