+class oRefCount
+{
+ int ref;
+public:
+ oRefCount(): ref(0) { }
+ operator int&() { return ref; }
+ ~oRefCount() {
+#ifdef OBJECT_DEBUG
+ if (ref) eDebug("OBJECT_DEBUG FATAL: %p has %d references!", this, ref); else eDebug("OBJECT_DEBUG refcount ok! (%p)", this);
+#endif
+ }
+};
+
+#ifndef SWIG
+#define DECLARE_REF(x) private: oRefCount ref; public: void AddRef(); void Release();