From 07ae40623737a6060b8a925fd2e6bba76780dcd4 Mon Sep 17 00:00:00 2001 From: Jason Sams Date: Thu, 27 Aug 2009 20:23:34 -0700 Subject: Implement async data/subData. Implement TriangleMeshBuilder in SimpleMesh which replaces TriangleMesh. Update Film to use new builder. --- libs/rs/rsObjectBase.h | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'libs/rs/rsObjectBase.h') diff --git a/libs/rs/rsObjectBase.h b/libs/rs/rsObjectBase.h index b2c33386e18e..d1e6baa0badb 100644 --- a/libs/rs/rsObjectBase.h +++ b/libs/rs/rsObjectBase.h @@ -30,8 +30,11 @@ public: ObjectBase(); virtual ~ObjectBase(); - void incRef() const; - void decRef() const; + void incSysRef() const; + void decSysRef() const; + + void incUserRef() const; + void decUserRef() const; const char * getName() const { return mName; @@ -41,13 +44,14 @@ public: private: char * mName; - mutable int32_t mRefCount; + mutable int32_t mSysRefCount; + mutable int32_t mUserRefCount; }; -template -class ObjectBaseRef +template +class ObjectBaseRef { public: ObjectBaseRef() { @@ -57,14 +61,14 @@ public: ObjectBaseRef(const ObjectBaseRef &ref) { mRef = ref.get(); if (mRef) { - mRef->incRef(); + mRef->incSysRef(); } } ObjectBaseRef(T *ref) { mRef = ref; if (mRef) { - ref->incRef(); + ref->incSysRef(); } } @@ -77,7 +81,7 @@ public: clear(); mRef = ref; if (mRef) { - ref->incRef(); + ref->incSysRef(); } } } @@ -88,7 +92,7 @@ public: void clear() { if (mRef) { - mRef->decRef(); + mRef->decSysRef(); } mRef = NULL; } @@ -97,8 +101,8 @@ public: return mRef; } - inline T * operator-> () const { - return mRef; + inline T * operator-> () const { + return mRef; } protected: -- cgit v1.2.3-59-g8ed1b