DynSharedI Class Reference
[DynI derived classes]

#include <DynObj.h>

Inheritance diagram for DynSharedI:

DynObj RefCountI DynI VObj

List of all members.

Public Member Functions

virtual DynObjType *docall doGetType (const DynI **pself=0) const
virtual int docall doAddRef ()=0
virtual int docall doRelease ()=0
virtual int docall IncRef ()
virtual int docall DecRef ()


Detailed Description

This is the base class for a ref-counted object. Derive from DynSharedI and implement ref-counting (support for atomic ref handling in pi/Atomic.h).

It adds ref counting methods to the object: doAddRef, doRelease. On object creation, it is assumed that the internal ref counter is set to 1 (NOTE: not 0).

DynSharedI derives from DynObj (more fundamental) since a ref-counted object depends on a mechanism to delete itself (which DynObj provides).

The DynSharedC is a default implementation that implements the ref counting methods.

There are some other helpful classes:


Member Function Documentation

virtual DynObjType* docall DynSharedI::doGetType ( const DynI **  pself = 0  )  const [virtual]

Returns type of this object. Each type that wants to make itself known should override this method. DynI knows its own type so we get the type without any lookup. It is faster and works without registration.

Parameters:
pself allows fetching the actual 'this' used inside doGetType (from a side base, this will be different to the 'this' of the caller).
Returns:
A DynObjType pointer

Reimplemented from DynObj.

virtual int docall DynSharedI::doAddRef (  )  [pure virtual]

Increases the reference count of the object

Returns:
the updated ref count value

virtual int docall DynSharedI::doRelease (  )  [pure virtual]

Decreares the reference count of the object and destroy if zero.

Returns:
the updated ref count value

virtual int docall DynSharedI::IncRef (  )  [inline, virtual]

Overrides for RefCountI base. Route to above functions.

Returns:
the updated ref count value

Implements RefCountI.


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

Generated on Sun Feb 15 16:35:57 2009 for DynObj by  doxygen 1.5.6