diff options
author | Ychebotarev ProductEngine <ychebotarev@productengine.com> | 2010-02-02 13:20:00 +0200 |
---|---|---|
committer | Ychebotarev ProductEngine <ychebotarev@productengine.com> | 2010-02-02 13:20:00 +0200 |
commit | fb174d1de39a2b551030da09e0dd9262b79278df (patch) | |
tree | e68c81bfbb13de6eff99436a6acb4b2179dd2012 /indra/llcommon/llrefcount.h | |
parent | e6538ddbe95f0c297e67b9f5decabfcb6241ed2a (diff) | |
parent | 9b0518dd8e46dfe74eaa0f7622b1486dbde32b82 (diff) |
merge
--HG--
branch : product-engine
Diffstat (limited to 'indra/llcommon/llrefcount.h')
-rw-r--r-- | indra/llcommon/llrefcount.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/indra/llcommon/llrefcount.h b/indra/llcommon/llrefcount.h index 9ab844eb22..a18f6706a9 100644 --- a/indra/llcommon/llrefcount.h +++ b/indra/llcommon/llrefcount.h @@ -41,22 +41,20 @@ class LL_COMMON_API LLRefCount { -private: - LLRefCount(const LLRefCount& other); // no implementation -private: - LLRefCount& operator=(const LLRefCount&); // no implementation protected: + LLRefCount(const LLRefCount& other); + LLRefCount& operator=(const LLRefCount&); virtual ~LLRefCount(); // use unref() public: LLRefCount(); - void ref() + void ref() const { mRef++; } - S32 unref() + S32 unref() const { llassert(mRef >= 1); if (0 == --mRef) @@ -67,13 +65,15 @@ public: return mRef; } + //NOTE: when passing around a const LLRefCount object, this can return different results + // at different types, since mRef is mutable S32 getNumRefs() const { return mRef; } private: - S32 mRef; + mutable S32 mRef; }; #endif |