OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
agg_util::RCObjectPool Class Reference

A monitoring "pool" class for created RCObject's which allows us to forcibly delete any RCOBject's regardless of their ref counts when we know we are done with them, say after an exception. More...

#include <RCObject.h>

Collaboration diagram for agg_util::RCObjectPool:
Collaboration graph

Public Member Functions

void add (RCObject *pObj)
 Add the object to the pool uniquely. More...
 
bool contains (RCObject *pObj) const
 
 RCObjectPool ()
 Create an empty pool. More...
 
void release (RCObject *pObj, bool shouldDelete=true)
 Tell the pool that the object's count is 0 and it can be released to be deleted or potentially reused again later. More...
 
void remove (RCObject *pObj)
 Remove the object from the pool, but don't delete it. More...
 
virtual ~RCObjectPool ()
 Forcibly delete all remaining objects in pool, regardless of ref count. More...
 

Protected Member Functions

void deleteAllObjects ()
 Call delete on all objects remaining in _liveObjects and clear it out. More...
 

Friends

class RCObject
 

Detailed Description

A monitoring "pool" class for created RCObject's which allows us to forcibly delete any RCOBject's regardless of their ref counts when we know we are done with them, say after an exception.

For now, this won't be a real pool, where objects are pre-allocated ahead of time and reused, etc. Support for this sort of thing will require a template class containing a vector of reusable objects for each type we need to factory up. At that point this will serve as a base class for the concrete pool.

Definition at line 58 of file RCObject.h.

Constructor & Destructor Documentation

agg_util::RCObjectPool::RCObjectPool ( )

Create an empty pool.

Definition at line 199 of file RCObject.cc.

agg_util::RCObjectPool::~RCObjectPool ( )
virtual

Forcibly delete all remaining objects in pool, regardless of ref count.

Definition at line 204 of file RCObject.cc.

References deleteAllObjects().

Here is the call graph for this function:

Member Function Documentation

void agg_util::RCObjectPool::add ( RCObject pObj)

Add the object to the pool uniquely.

When the pool is destroyed, pObj will be destroyed as well, regardless of its count, if it is still live.

Definition at line 217 of file RCObject.cc.

References contains().

Referenced by agg_util::RCObject::RCObject().

Here is the call graph for this function:

bool agg_util::RCObjectPool::contains ( RCObject pObj) const
Returns
whether the pool is currently monitoring the object or not.

Definition at line 210 of file RCObject.cc.

Referenced by add(), and release().

void agg_util::RCObjectPool::deleteAllObjects ( )
protected

Call delete on all objects remaining in _liveObjects and clear it out.

After call, _liveObjects.empty().

Definition at line 258 of file RCObject.cc.

References BESDEBUG.

Referenced by ~RCObjectPool().

void agg_util::RCObjectPool::release ( RCObject pObj,
bool  shouldDelete = true 
)

Tell the pool that the object's count is 0 and it can be released to be deleted or potentially reused again later.

Users should not call this.

Parameters
pObjthe object to remove from the pool.
shouldDeletewhether this call should call delete on pObj, or just remove it.

Definition at line 228 of file RCObject.cc.

References BESDEBUG, and contains().

Referenced by remove(), and agg_util::RCObject::unref().

Here is the call graph for this function:

void agg_util::RCObjectPool::remove ( RCObject pObj)
inline

Remove the object from the pool, but don't delete it.

Parameters
pObjobject to remove from the auto delete pool.

Definition at line 82 of file RCObject.h.

References release().

Referenced by agg_util::RCObject::removeFromPool().

Here is the call graph for this function:

Friends And Related Function Documentation

friend class RCObject
friend

Definition at line 60 of file RCObject.h.


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