/* we don't allow the default operator here, as it would break the refcount. */
void operator=(const iObject &);
protected:
+ void operator delete(void *p) { ::operator delete(p); }
virtual ~iObject() { }
+#ifdef SWIG
+ virtual void AddRef()=0;
+ virtual void Release()=0;
+#endif
public:
+#ifndef SWIG
virtual void AddRef()=0;
virtual void Release()=0;
+#endif
};
#ifndef SWIG
#if defined(OBJECT_DEBUG)
extern int object_total_remaining;
#define DECLARE_REF(x) \
- private:oRefCount ref; \
- eSingleLock ref_lock; \
public: void AddRef(); \
- void Release();
+ void Release(); \
+ private:oRefCount ref; \
+ eSingleLock ref_lock;
#define DEFINE_REF(c) \
void c::AddRef() \
{ \
}
#elif defined(__mips__)
#define DECLARE_REF(x) \
- private: oRefCount ref; \
public: void AddRef(); \
- void Release();
+ void Release(); \
+ private: oRefCount ref;
#define DEFINE_REF(c) \
void c::AddRef() \
{ \
}
#elif defined(__ppc__) || defined(__powerpc__)
#define DECLARE_REF(x) \
- private: oRefCount ref; \
public: void AddRef(); \
- void Release();
+ void Release(); \
+ private: oRefCount ref;
#define DEFINE_REF(c) \
void c::AddRef() \
{ \
}
#elif defined(__i386__) || defined(__x86_64__)
#define DECLARE_REF(x) \
- private: oRefCount ref; \
public: void AddRef(); \
- void Release();
+ void Release(); \
+ private: oRefCount ref;
#define DEFINE_REF(c) \
void c::AddRef() \
{ \
#else
#warning use non optimized implementation of refcounting.
#define DECLARE_REF(x) \
- private:oRefCount ref; \
- eSingleLock ref_lock; \
public: void AddRef(); \
- void Release();
+ void Release(); \
+ private:oRefCount ref; \
+ eSingleLock ref_lock;
#define DEFINE_REF(c) \
void c::AddRef() \
{ \
private: \
void AddRef(); \
void Release();
- class Object
- {
- };
#endif // SWIG
#endif // __base_object_h