X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fbase%2Fobject.h;h=a3268d4f3851de9357ba3d749891b4829e87b95a;hp=1723a885d994c9188815a58d2207590b7af38daf;hb=36cca1d3f31265929ef3443999ab7fd242b4dae5;hpb=c9c138dd06d5eee865c0dd825fb728913ed4a8f0 diff --git a/lib/base/object.h b/lib/base/object.h index 1723a88..a3268d4 100644 --- a/lib/base/object.h +++ b/lib/base/object.h @@ -17,10 +17,17 @@ private: /* 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 @@ -43,10 +50,10 @@ public: #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() \ { \ @@ -68,9 +75,9 @@ public: } #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() \ { \ @@ -108,9 +115,9 @@ public: } #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() \ { \ @@ -142,9 +149,9 @@ public: } #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() \ { \ @@ -165,10 +172,10 @@ public: #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() \ { \ @@ -190,9 +197,6 @@ public: private: \ void AddRef(); \ void Release(); - class Object - { - }; #endif // SWIG #endif // __base_object_h