author | zecke <zecke> | 2004-11-18 21:36:33 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-11-18 21:36:33 (UTC) |
commit | 3302eb30390e6053637929316670da3e8fbe279e (patch) (side-by-side diff) | |
tree | 5d8eb530e081a95b2ee5152ef63575b6c966154c /libopie2/opiecore/osmartpointer.h | |
parent | 7ac32658ba09d8456cc75e5cf80707caa616848b (diff) | |
download | opie-3302eb30390e6053637929316670da3e8fbe279e.zip opie-3302eb30390e6053637929316670da3e8fbe279e.tar.gz opie-3302eb30390e6053637929316670da3e8fbe279e.tar.bz2 |
-Move ORefCount to a non inline implementation in osmartpointer.cpp
-Add OSharedPointer as a smart pointer adapter to adapt any pointer
This is used by Opie PIM
Change pro file
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 @@ -48,22 +48,17 @@ namespace Core { 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 |