4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // Stefan Bund <g0dil@berlios.de>
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.
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.
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.
24 \brief pimpl_ptr public header */
26 #ifndef HH_SENF_senf_Utils_pimpl_ptr_
27 #define HH_SENF_senf_Utils_pimpl_ptr_ 1
31 #include <boost/ptr_container/clone_allocator.hpp>
33 //#include "pimpl_ptr.mpp"
34 ///////////////////////////////hh.p////////////////////////////////////////
39 template<typename T, class CloneAllocator=boost::heap_clone_allocator>
42 typedef void (*Deleter)(T* p);
43 typedef T* (*Copier)(const T* p);
46 explicit pimpl_ptr(T* pointee);
47 pimpl_ptr(const pimpl_ptr & rhs);
50 const T* get() const throw();
53 const T* operator->() const throw();
54 T* operator->() throw();
56 const T& operator*() const throw();
57 T& operator*() throw();
59 void swap(pimpl_ptr& with) throw();
61 pimpl_ptr & operator=(const pimpl_ptr & rhs);
64 static Copier doCopy_;
65 static Deleter doDelete_;
68 static void myDeleteFn(T* p);
69 static T* myCopyFn(const T* p);
76 template<class T, class CloneAllocator>
77 void swap(senf::pimpl_ptr<T,CloneAllocator>& lhs, senf::pimpl_ptr<T,CloneAllocator>& rhs)
81 ///////////////////////////////hh.e////////////////////////////////////////
82 //#include "pimpl_ptr.cci"
83 //#include "pimpl_ptr.ct"
84 #include "pimpl_ptr.cti"
92 // c-file-style: "senf"
93 // indent-tabs-mode: nil
94 // ispell-local-dictionary: "american"
95 // compile-command: "scons -u test"