diff options
author | richard <none@none> | 2010-02-01 12:39:59 -0800 |
---|---|---|
committer | richard <none@none> | 2010-02-01 12:39:59 -0800 |
commit | 45e700cb3ef9c56aaf373a8b4acafb4fc07a5972 (patch) | |
tree | 394d990d038387952d0668da989dd4d7da072c86 /indra/llcommon/llrefcount.h | |
parent | c339017d2e156a68f1e300a7668f2a9f6e6141f7 (diff) | |
parent | f99a7b23ae0cee0d3e96b0b89d82e5c35bb07433 (diff) |
merge
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 |