-rw-r--r-- | libopie2/opiecore/osmartpointer.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libopie2/opiecore/osmartpointer.h b/libopie2/opiecore/osmartpointer.h index 8f9da7f..c7dc9d9 100644 --- a/libopie2/opiecore/osmartpointer.h +++ b/libopie2/opiecore/osmartpointer.h | |||
@@ -11,48 +11,50 @@ _;:, .> :=|. This program is free software; you can | |||
11 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 11 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
12 | .="- .-=="i, .._ License as published by the Free Software | 12 | .="- .-=="i, .._ License as published by the Free Software |
13 | - . .-<_> .<> Foundation; either version 2 of the License, | 13 | - . .-<_> .<> Foundation; either version 2 of the License, |
14 | ._= =} : or (at your option) any later version. | 14 | ._= =} : or (at your option) any later version. |
15 | .%`+i> _;_. | 15 | .%`+i> _;_. |
16 | .i_,=:_. -<s. This program is distributed in the hope that | 16 | .i_,=:_. -<s. This program is distributed in the hope that |
17 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 17 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
18 | : .. .:, . . . without even the implied warranty of | 18 | : .. .:, . . . without even the implied warranty of |
19 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 19 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
20 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 20 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
21 | ..}^=.= = ; Library General Public License for more | 21 | ..}^=.= = ; Library General Public License for more |
22 | ++= -. .` .: details. | 22 | ++= -. .` .: details. |
23 | : = ...= . :.=- | 23 | : = ...= . :.=- |
24 | -. .:....=;==+<; You should have received a copy of the GNU | 24 | -. .:....=;==+<; You should have received a copy of the GNU |
25 | -_. . . )=. = Library General Public License along with | 25 | -_. . . )=. = Library General Public License along with |
26 | -- :-=` this library; see the file COPYING.LIB. | 26 | -- :-=` this library; see the file COPYING.LIB. |
27 | If not, write to the Free Software Foundation, | 27 | If not, write to the Free Software Foundation, |
28 | Inc., 59 Temple Place - Suite 330, | 28 | Inc., 59 Temple Place - Suite 330, |
29 | Boston, MA 02111-1307, USA. | 29 | Boston, MA 02111-1307, USA. |
30 | */ | 30 | */ |
31 | 31 | ||
32 | #ifndef _OSmartPointer_h | 32 | #ifndef _OSmartPointer_h |
33 | #define _OSmartPointer_h | 33 | #define _OSmartPointer_h |
34 | 34 | ||
35 | #include <stddef.h> | ||
36 | |||
35 | /*! | 37 | /*! |
36 | * \file OSmartPointer.h | 38 | * \file OSmartPointer.h |
37 | * \brief smart pointer and reference counter | 39 | * \brief smart pointer and reference counter |
38 | * \author Rajko Albrecht | 40 | * \author Rajko Albrecht |
39 | * | 41 | * |
40 | */ | 42 | */ |
41 | 43 | ||
42 | namespace Opie { | 44 | namespace Opie { |
43 | namespace Core { | 45 | namespace Core { |
44 | 46 | ||
45 | //! simple reference counter class | 47 | //! simple reference counter class |
46 | class ORefCount { | 48 | class ORefCount { |
47 | protected: | 49 | protected: |
48 | //! reference count member | 50 | //! reference count member |
49 | long m_RefCount; | 51 | long m_RefCount; |
50 | public: | 52 | public: |
51 | //! first reference must be added after "new" via Pointer() | 53 | //! first reference must be added after "new" via Pointer() |
52 | ORefCount() : m_RefCount(0) | 54 | ORefCount() : m_RefCount(0) |
53 | {} | 55 | {} |
54 | virtual ~ORefCount() {} | 56 | virtual ~ORefCount() {} |
55 | //! add a reference | 57 | //! add a reference |
56 | void Incr() { | 58 | void Incr() { |
57 | ++m_RefCount; | 59 | ++m_RefCount; |
58 | } | 60 | } |