summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/osmartpointer.h
authorzecke <zecke>2004-11-18 21:36:33 (UTC)
committer zecke <zecke>2004-11-18 21:36:33 (UTC)
commit3302eb30390e6053637929316670da3e8fbe279e (patch) (unidiff)
tree5d8eb530e081a95b2ee5152ef63575b6c966154c /libopie2/opiecore/osmartpointer.h
parent7ac32658ba09d8456cc75e5cf80707caa616848b (diff)
downloadopie-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.h17
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 {
48class ORefCount { 48class ORefCount {
49protected: 49protected:
50 //! reference count member 50 //! reference count member
51 long m_RefCount; 51 unsigned long m_RefCount;
52public: 52public:
53 //! first reference must be added after "new" via Pointer() 53 //! first reference must be added after "new" via Pointer()
54 ORefCount() : m_RefCount(0) 54 ORefCount();
55 {} 55 virtual ~ORefCount();
56 virtual ~ORefCount() {}
57 //! add a reference 56 //! add a reference
58 void Incr() { 57 void Incr();
59 ++m_RefCount;
60 }
61 //! delete a reference 58 //! delete a reference
62 void Decr() { 59 void Decr();
63 --m_RefCount;
64 }
65 //! is it referenced 60 //! is it referenced
66 bool Shared() { return (m_RefCount > 0); } 61 bool Shared();
67}; 62};
68 63
69//! reference counting wrapper class 64//! reference counting wrapper class