Diffstat (limited to 'libopie2/opiecore/osmartpointer.h') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiecore/osmartpointer.h | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/libopie2/opiecore/osmartpointer.h b/libopie2/opiecore/osmartpointer.h index e9cee0c..f2f6464 100644 --- a/libopie2/opiecore/osmartpointer.h +++ b/libopie2/opiecore/osmartpointer.h @@ -45,28 +45,23 @@ namespace Opie { namespace Core { //! simple reference counter class class ORefCount { protected: //! reference count member - long m_RefCount; + unsigned long m_RefCount; public: //! first reference must be added after "new" via Pointer() - ORefCount() : m_RefCount(0) - {} - virtual ~ORefCount() {} + ORefCount(); + virtual ~ORefCount(); //! add a reference - void Incr() { - ++m_RefCount; - } + void Incr(); //! delete a reference - void Decr() { - --m_RefCount; - } + void Decr(); //! is it referenced - bool Shared() { return (m_RefCount > 0); } + bool Shared(); }; //! reference counting wrapper class template<class T> class OSmartPointer { //! pointer to object /*! |