Blockstructured Adaptive Mesh Refinement in object-oriented C++
#include <ObjectCounter.h>
Inheritance diagram for ObjectCounter:
Public Methods | |
ObjectCounter () | |
ObjectCounter * | alias () |
void | free () |
virtual | ~ObjectCounter () |
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)
Definition at line 23 of file ObjectCounter.h.
Quickstart Users Guide Programmers Reference Installation Examples Download
AMROC Main Home Contactlast update: 06/01/04