diff options
author | Sven Hesse | 2007-03-29 17:55:39 +0000 |
---|---|---|
committer | Sven Hesse | 2007-03-29 17:55:39 +0000 |
commit | 623ca8802269914ab90a1127f89c66dd2cb571f1 (patch) | |
tree | 184d67b016a4a3808d7b8a19946c071db39105ac /engines/gob/gob.h | |
parent | 69639ea0bf28e3ca7526617304859d359b58063b (diff) | |
download | scummvm-rg350-623ca8802269914ab90a1127f89c66dd2cb571f1.tar.gz scummvm-rg350-623ca8802269914ab90a1127f89c66dd2cb571f1.tar.bz2 scummvm-rg350-623ca8802269914ab90a1127f89c66dd2cb571f1.zip |
- Properly implemented the ImdPlayer
- Some more clean-up
svn-id: r26316
Diffstat (limited to 'engines/gob/gob.h')
-rw-r--r-- | engines/gob/gob.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/engines/gob/gob.h b/engines/gob/gob.h index 6f64053fe6..a3da4f4fd3 100644 --- a/engines/gob/gob.h +++ b/engines/gob/gob.h @@ -109,11 +109,14 @@ class ReferenceCounter { public: class Ptr { public: - T* operator-> () { return _p; } - T& operator* () { return *_p; } + bool operator==(const Ptr &p) const { return _p == p._p; } + bool operator==(const ReferenceCounter *p) const { return _p == p; } + + T *operator-> () { return _p; } + T &operator* () { return *_p; } operator T*() { return _p; } - Ptr(T* p) : _p(p) { ++_p->_references; } + Ptr(T *p) : _p(p) { ++_p->_references; } Ptr() : _p(0) { } ~Ptr() { @@ -121,16 +124,16 @@ public: delete _p; } - Ptr(const Ptr& p) : _p(p._p) { ++_p->_references; } + Ptr(const Ptr &p) : _p(p._p) { ++_p->_references; } - Ptr& operator= (const Ptr& p) { + Ptr &operator= (const Ptr &p) { ++p._p->_references; if (_p && (--_p->_references == 0)) delete _p; _p = p._p; return *this; } - Ptr* operator= (const Ptr* p) { + Ptr *operator= (const Ptr *p) { if (p) ++p->_p->_references; if (_p && (--_p->_references == 0)) @@ -141,7 +144,7 @@ public: } private: - T* _p; + T *_p; }; ReferenceCounter() : _references(0) { } |