Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | Related Pages

RefCounter Class Reference

#include <pointer.h>

Inheritance diagram for RefCounter:

Inheritance graph
[legend]
List of all members.

Detailed Description

Base reference counter Used by all objects that are managed through smart pointers Once reference count reaches zero, deletes itself. You must NEVER delete a reference counted object directly! All access to a reference counted object MUST be done through the smart pointer interface as offered by the Pointer template class.

Author:
Mattias Jansson (mattias@realityrift.com)


Public Member Functions

 RefCounter ()
virtual ~RefCounter ()
void IncRef ()
void DecRef ()
int GetRefCount () const

Private Attributes

int m_iRefCount


Constructor & Destructor Documentation

RefCounter  )  [inline]
 

Set reference count to 0

~RefCounter  )  [inline, virtual]
 

Dummy method for virtual destructor chain


Member Function Documentation

void IncRef  )  [inline]
 

Increase reference count

void DecRef  )  [inline]
 

Decrease reference count and garbage collect if 0

int GetRefCount  )  const [inline]
 

Returns:
Current reference count


Member Data Documentation

int m_iRefCount [private]
 

Reference count


The documentation for this class was generated from the following file:
Generated on Wed Jan 21 14:21:13 2004 for NeoEngine by doxygen 1.3.5