ObjectCounter Class Reference

Provides a reference counting base class. More...

#include <ObjectCounter.h>

Inheritance diagram for ObjectCounter:
BBoxList GridBoxList GridDataBucketVoid GridUnitList GridDataBucket< Type >

List of all members.

Public Member Functions

 ObjectCounter ()
ObjectCounteralias ()
void free ()
virtual ~ObjectCounter ()

Detailed Description

Provides a reference counting base class.

The class counts the number of references to itself and destroys itself when the count goes to zero. Subclasses should be manipulated as follows: class CountedClass : public ObjectCounter { ... } CountedClass *x = new CountedClass(...); CountedClass *y = (CountedClass *) x->alias(); x->free(); y->free(); To avoid forcing the case on alias(), define an alias() in the subclass which does the cast for you.

Author:
: Scott Kohn (skohn@cs.ucsd.edu)

Constructor & Destructor Documentation

ObjectCounter::ObjectCounter (  )  [inline]
virtual ObjectCounter::~ObjectCounter (  )  [inline, virtual]

Member Function Documentation

ObjectCounter* ObjectCounter::alias (  )  [inline]
void ObjectCounter::free (  )  [inline]

The documentation for this class was generated from the following file:
Generated on Thu Jun 30 02:19:00 2016 for AMROC's Hierachical Data Structures by  doxygen 1.6.3