Main Page   Class Hierarchy   Compound List   File List   Compound Members   Related Pages  

GEN_Shared Class Reference

A shared object with reference counting. More...

#include <GEN_Shared.h>

Inheritance diagram for GEN_Shared:

ACT_Action ACT_TestAction List of all members.

Public Methods

 GEN_Shared ()
 Constructs a a shared object.

virtual int getRef ()const
 Returns the reference count of this object. More...

virtual int incRef ()
 Increases the reference count of this object. More...

virtual int decRef ()
 Decreases the reference count of this object. More...


Protected Methods

virtual ~GEN_Shared ()
 Destructs a shared object. More...


Protected Attributes

int m_refCount
 The reference count.


Detailed Description

A shared object with reference counting.

Base class for objects with reference counting. Shared objects are created with a reference count of one. The creator of a shared object is responsible for decreasing it. If the the reference count of a shared object reaches zero, the object self-destructs. The default destructor of this object has been made protected on purpose so as not to allow shared objects to be created on the stack.

Author(s):
Maarten Gribnau
Date:
March 31, 2001


Constructor & Destructor Documentation

GEN_Shared::~GEN_Shared ( ) [inline, protected, virtual]
 

Destructs a shared object.

The destructor is protected to force the use of incRef and decRef.


Member Function Documentation

int GEN_Shared::decRef ( ) [inline, virtual]
 

Decreases the reference count of this object.

If the the reference count reaches zero, the object self-destructs.

Returns:
the new reference count.

int GEN_Shared::getRef ( ) const [inline, virtual]
 

Returns the reference count of this object.

Returns:
the reference count.

int GEN_Shared::incRef ( ) [inline, virtual]
 

Increases the reference count of this object.

Returns:
the new reference count.


The documentation for this class was generated from the following file:
Generated at Thu May 3 18:16:00 2001 for ActionLib by doxygen1.2.4 written by Dimitri van Heesch, © 1997-2000