summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/osmartpointer.h
Unidiff
Diffstat (limited to 'libopie2/opiecore/osmartpointer.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/osmartpointer.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/libopie2/opiecore/osmartpointer.h b/libopie2/opiecore/osmartpointer.h
index 9000e71..8f9da7f 100644
--- a/libopie2/opiecore/osmartpointer.h
+++ b/libopie2/opiecore/osmartpointer.h
@@ -31,24 +31,25 @@ _;:, .> :=|. This program is free software; you can
31 31
32#ifndef _OSmartPointer_h 32#ifndef _OSmartPointer_h
33#define _OSmartPointer_h 33#define _OSmartPointer_h
34 34
35/*! 35/*!
36 * \file OSmartPointer.h 36 * \file OSmartPointer.h
37 * \brief smart pointer and reference counter 37 * \brief smart pointer and reference counter
38 * \author Rajko Albrecht 38 * \author Rajko Albrecht
39 * 39 *
40 */ 40 */
41 41
42namespace Opie { 42namespace Opie {
43namespace Core {
43 44
44//! simple reference counter class 45//! simple reference counter class
45class ORefCount { 46class ORefCount {
46protected: 47protected:
47 //! reference count member 48 //! reference count member
48 long m_RefCount; 49 long m_RefCount;
49public: 50public:
50 //! first reference must be added after "new" via Pointer() 51 //! first reference must be added after "new" via Pointer()
51 ORefCount() : m_RefCount(0) 52 ORefCount() : m_RefCount(0)
52 {} 53 {}
53 virtual ~ORefCount() {} 54 virtual ~ORefCount() {}
54 //! add a reference 55 //! add a reference
@@ -131,15 +132,16 @@ public:
131 //! supports "if (pointer)" 132 //! supports "if (pointer)"
132 operator bool () const { return (ptr != NULL); } 133 operator bool () const { return (ptr != NULL); }
133 //! "if (pointer)" as non const 134 //! "if (pointer)" as non const
134 operator bool () { return ptr != NULL;} 135 operator bool () { return ptr != NULL;}
135 136
136 //! support if (!pointer)" 137 //! support if (!pointer)"
137 bool operator! () const { return (ptr == NULL); } 138 bool operator! () const { return (ptr == NULL); }
138 //! support if (!pointer)" as non const 139 //! support if (!pointer)" as non const
139 bool operator! () { return (ptr == NULL); } 140 bool operator! () { return (ptr == NULL); }
140}; 141};
141 142
142} 143}
144}
143 145
144#endif 146#endif
145 147