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


Main Page   Class Hierarchy   Compound List   File List  

ObjectCounter.h

Go to the documentation of this file.
00001 #ifndef _included_ObjectCounter_h
00002 #define _included_ObjectCounter_h
00003 
00023 class ObjectCounter
00024   {
00025    int references;
00026 public:
00027    inline ObjectCounter() : references(1) { }
00028    inline ObjectCounter *alias() { references++; return(this); }
00029    inline void free() { if (--references == 0) delete this; }
00030    // Make sure all the derived classes have their destructors;
00031    inline virtual ~ObjectCounter() { }
00032   };
00033 
00034 #endif


Quickstart     Users Guide     Programmers Reference     Installation      Examples     Download



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