#ifndef __RAK_SMART_OBJECT_H #define __RAK_SMART_OBJECT_H #include class RakSmartObj { public: RakSmartObj() {refCount=0;} virtual ~RakSmartObj() {assert(refCount==0);} void IncRefCount(void) {refCount++;} void DecRefCount(void) {--refCount; if (refCount==0) delete this;} int GetRefCount(void) const {return refCount;} protected: int refCount; }; #endif