AMROC Main     Blockstructured Adaptive Mesh Refinement in object-oriented C++


Main Page   Class Hierarchy   Compound List   File List  

ObjectCounter Class Reference

Provides a reference counting base class. More...

#include <ObjectCounter.h>

Inheritance diagram for ObjectCounter:

Inheritance graph
[legend]
List of all members.

Public Methods

 ObjectCounter ()
ObjectCounter * alias ()
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)

Definition at line 23 of file ObjectCounter.h.


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


Quickstart     Users Guide     Programmers Reference     Installation      Examples     Download



AMROC Main      Home      Contact
last update: 06/01/04