Fix documentation build under maverick (doxygen 1.7.1)
[senf.git] / senf / Utils / pimpl_ptr.hh
1 // $Id$
2 //
3 // Copyright (C) 2010
4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 //     Stefan Bund <g0dil@berlios.de>
7 //
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
12 //
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 // GNU General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22
23 /** \file
24     \brief pimpl_ptr public header */
25
26 #ifndef HH_SENF_senf_Utils_pimpl_ptr_
27 #define HH_SENF_senf_Utils_pimpl_ptr_ 1
28
29 // Custom includes
30 #include <algorithm>
31 #include <boost/ptr_container/clone_allocator.hpp>
32
33 //#include "pimpl_ptr.mpp"
34 //-/////////////////////////////////////////////////////////////////////////////////////////////////
35
36 namespace senf
37 {
38
39     template<typename T, class CloneAllocator=boost::heap_clone_allocator>
40     class pimpl_ptr
41     {
42         typedef void (*Deleter)(T* p);
43         typedef T* (*Copier)(const T* p);
44
45     public:
46         explicit pimpl_ptr(T* pointee);
47         pimpl_ptr(const pimpl_ptr & rhs);
48         ~pimpl_ptr() throw();
49
50         const T* get() const throw();
51         T* get() throw();
52
53         const T* operator->() const throw();
54         T* operator->() throw();
55
56         const T& operator*() const throw();
57         T& operator*() throw();
58
59         void swap(pimpl_ptr& with) throw();
60
61         pimpl_ptr & operator=(const pimpl_ptr & rhs);
62
63     private:
64         static Copier doCopy_;
65         static Deleter doDelete_;
66         T* p;
67
68         static void myDeleteFn(T* p);
69         static T* myCopyFn(const T* p);
70     };
71
72 }
73
74 namespace std
75 {
76     template<class T, class CloneAllocator>
77     void swap(senf::pimpl_ptr<T,CloneAllocator>& lhs, senf::pimpl_ptr<T,CloneAllocator>& rhs)
78         throw();
79 }
80
81 //-/////////////////////////////////////////////////////////////////////////////////////////////////
82 //#include "pimpl_ptr.cci"
83 //#include "pimpl_ptr.ct"
84 #include "pimpl_ptr.cti"
85 #endif
86
87 \f
88 // Local Variables:
89 // mode: c++
90 // fill-column: 100
91 // comment-column: 40
92 // c-file-style: "senf"
93 // indent-tabs-mode: nil
94 // ispell-local-dictionary: "american"
95 // compile-command: "scons -u test"
96 // End: