diff options
Diffstat (limited to 'indra/llcommon')
-rw-r--r-- | indra/llcommon/llpointer.h | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/indra/llcommon/llpointer.h b/indra/llcommon/llpointer.h index b9a9bf1ef0..c83e55577d 100644 --- a/indra/llcommon/llpointer.h +++ b/indra/llcommon/llpointer.h @@ -170,45 +170,32 @@ class LLCopyOnWritePointer : public LLPointer<Type> { public: typedef LLCopyOnWritePointer<Type> self_t; - + typedef LLPointer<Type> pointer_t; + LLCopyOnWritePointer() {} LLCopyOnWritePointer(Type* ptr) - : LLPointer(ptr) + : LLPointer<Type>(ptr) {} LLCopyOnWritePointer(LLPointer<Type>& ptr) - : LLPointer(ptr) + : LLPointer<Type>(ptr) {} Type* write() { makeUnique(); - return mPointer; + return pointer_t::mPointer; } void makeUnique() { - if (notNull() && mPointer->getNumRefs() > 1) + if (pointer_t::notNull() && pointer_t::mPointer->getNumRefs() > 1) { - *(LLPointer*)(this) = new Type(*mPointer); + *(pointer_t*)(this) = new Type(*pointer_t::mPointer); } } - /*operator BOOL() const { return (mPointer != NULL); } - operator bool() const { return (mPointer != NULL); } - bool operator!() const { return (mPointer == NULL); } - bool isNull() const { return (mPointer == NULL); } - bool notNull() const { return (mPointer != NULL); } - - bool operator !=(Type* ptr) const { return (mPointer != ptr); } - bool operator ==(Type* ptr) const { return (mPointer == ptr); } - bool operator ==(const LLCopyOnWritePointer<Type>& ptr) const { return (mPointer == ptr.mPointer); } - bool operator < (const LLCopyOnWritePointer<Type>& ptr) const { return (mPointer < ptr.mPointer); } - bool operator > (const LLCopyOnWritePointer<Type>& ptr) const { return (mPointer > ptr.mPointer); } - - operator const Type*() const { return mPointer; } - const Type* operator->() const { return mPointer; }*/ }; #endif |