AbstractObjectRecycler Class Reference

An interface that must be implemented by all ObjectPool classes. More...

#include <ObjectPool.h>

Inheritance diagram for AbstractObjectRecycler:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 AbstractObjectRecycler ()
 Default constructor.
virtual ~AbstractObjectRecycler ()
 Default destructor.
virtual void RecycleObject (void *obj)=0
 Should be implemented to downcast (obj) to the correct type, and recycle it (typically by calling ReleaseObject().
virtual uint32 FlushCachedObjects ()=0
 Should be implemented to destroy all objects we have cached and return the number of objects that were destroyed.

Static Public Member Functions

static void GlobalFlushAllCachedObjects ()
 Walks the linked list of all AbstractObjectRecyclers, calling FlushCachedObjects() on each one, until all cached objects have been destroyed.

Detailed Description

An interface that must be implemented by all ObjectPool classes.

Used to support polymorphism in our reference counting.

Definition at line 43 of file ObjectPool.h.


Constructor & Destructor Documentation

AbstractObjectRecycler::AbstractObjectRecycler (  ) 

Default constructor.

Registers us with the global recyclers list.

virtual AbstractObjectRecycler::~AbstractObjectRecycler (  )  [virtual]

Default destructor.

Unregisters us from the global recyclers list.


Member Function Documentation

virtual void AbstractObjectRecycler::RecycleObject ( void *  obj  )  [pure virtual]

Should be implemented to downcast (obj) to the correct type, and recycle it (typically by calling ReleaseObject().

Parameters:
obj Pointer to the object to recycle. Must point to an object of the correct type. May be NULL, in which case this method is a no-op.

Implemented in ObjectPool< Object >.

static void AbstractObjectRecycler::GlobalFlushAllCachedObjects (  )  [static]

Walks the linked list of all AbstractObjectRecyclers, calling FlushCachedObjects() on each one, until all cached objects have been destroyed.

This method is called by the SetupSystem destructor, to ensure that all objects have been deleted before main() returns, so that shutdown ordering issues do not cause bad memory writes, etc.


The documentation for this class was generated from the following file:
Generated on Thu Jun 5 17:47:57 2008 for MUSCLE by  doxygen 1.5.1