TMCSMPCountedObject Class Reference
[MCCore]

Inheritance diagram for TMCSMPCountedObject:

IMCUnknown FacetMesh TBasicSmpThread TCountedRenderable TCountedRenderingCallbacks TCountedTimeBased TFacetCache TInstanceList TInstancePath TMCCountedBlock< T > List of all members.

Public Member Functions

virtual MCErr MCCOMAPI QueryInterface (const MCIID &riid, void **ppvObj)
virtual uint32 MCCOMAPI AddRef ()
virtual uint32 MCCOMAPI Release ()

Static Public Member Functions

void Create (TMCSMPCountedObject **outObject)

Protected Member Functions

 TMCSMPCountedObject ()
virtual ~TMCSMPCountedObject ()

Protected Attributes

TMCAtomicCounter * fRefCountAC

Detailed Description

Counted objects are objects that use a counter to keep track of how many other objects need them, and delete themselves when nobody needs them anymore. A counted object has an AddRef method that increments its counter, and a Release method that decrements it. When the value of the counter reaches zero, the object is deleted.

Take a look at TMCCountedCreateHelper to see how to create and return a counted object


Constructor & Destructor Documentation

TMCSMPCountedObject::TMCSMPCountedObject (   )  [protected]
 

virtual TMCSMPCountedObject::~TMCSMPCountedObject (   )  [protected, virtual]
 


Member Function Documentation

uint32 TMCSMPCountedObject::AddRef (   )  [inline, virtual]
 

Increments the reference count of the object

Implements IMCUnknown.

Reimplemented in TCountedTimeBased, TCountedRenderable, TCountedRenderingCallbacks, and TBasicSmpThread.

void TMCSMPCountedObject::Create (  TMCSMPCountedObject **  outObject  )  [static]
 

virtual MCErr MCCOMAPI TMCSMPCountedObject::QueryInterface (  const MCIID &  riid,
void **  ppvObj
)  [virtual]
 

Check if the object supports a given interface and returns a pointer to that interface if it does. Note that QueryInterface will increment the reference count of the object by one if the interface is found.

Parameters:
riid GUID of the interface
ppvObj A pointer to the pointer being returned.

Implements IMCUnknown.

Reimplemented in TCountedTimeBased, TCountedRenderable, TCountedRenderingCallbacks, and TBasicSmpThread.

uint32 TMCSMPCountedObject::Release (   )  [inline, virtual]
 

Decrements the reference count of the object. If the reference count reaches zero, the object is destroyed.

Implements IMCUnknown.

Reimplemented in TCountedTimeBased, TCountedRenderable, TCountedRenderingCallbacks, and TBasicSmpThread.


Member Data Documentation

TMCAtomicCounter* TMCSMPCountedObject::fRefCountAC [protected]
 


The documentation for this class was generated from the following file:
Generated on Mon Mar 14 12:29:09 2005 for Carrara SDK Doc by  doxygen 1.3.9.1