Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/boost/interprocess/smart_ptr/deleter.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 //////////////////////////////////////////////////////////////////////////////
0002 //
0003 // (C) Copyright Ion Gaztanaga 2007-2012.
0004 //
0005 // Distributed under the Boost Software License, Version 1.0.
0006 // (See accompanying file LICENSE_1_0.txt or copy at
0007 // http://www.boost.org/LICENSE_1_0.txt)
0008 //
0009 // See http://www.boost.org/libs/interprocess for documentation.
0010 //
0011 //////////////////////////////////////////////////////////////////////////////
0012 
0013 #ifndef BOOST_INTERPROCESS_DELETER_HPP
0014 #define BOOST_INTERPROCESS_DELETER_HPP
0015 
0016 #ifndef BOOST_CONFIG_HPP
0017 #  include <boost/config.hpp>
0018 #endif
0019 #
0020 #if defined(BOOST_HAS_PRAGMA_ONCE)
0021 #  pragma once
0022 #endif
0023 
0024 #include <boost/interprocess/detail/config_begin.hpp>
0025 #include <boost/interprocess/interprocess_fwd.hpp>
0026 #include <boost/interprocess/detail/utilities.hpp>
0027 #include <boost/intrusive/pointer_traits.hpp>
0028 
0029 //!\file
0030 //!Describes the functor to delete objects from the segment.
0031 
0032 namespace boost {
0033 namespace interprocess {
0034 
0035 //!A deleter that uses the segment manager's destroy_ptr
0036 //!function to destroy the passed pointer resource.
0037 //!
0038 //!This deleter is used
0039 template<class T, class SegmentManager>
0040 class deleter
0041 {
0042    public:
0043    typedef typename boost::intrusive::
0044       pointer_traits<typename SegmentManager::void_pointer>::template
0045          rebind_pointer<T>::type                pointer;
0046 
0047    private:
0048    typedef typename boost::intrusive::
0049       pointer_traits<pointer>::template
0050          rebind_pointer<SegmentManager>::type                segment_manager_pointer;
0051 
0052    segment_manager_pointer mp_mngr;
0053 
0054    public:
0055    deleter(segment_manager_pointer pmngr) BOOST_NOEXCEPT
0056       :  mp_mngr(pmngr)
0057    {}
0058 
0059    void operator()(const pointer &p)
0060    {  mp_mngr->destroy_ptr(ipcdetail::to_raw_pointer(p));   }
0061 };
0062 
0063 }  //namespace interprocess {
0064 }  //namespace boost {
0065 
0066 #include <boost/interprocess/detail/config_end.hpp>
0067 
0068 #endif   //#ifndef BOOST_INTERPROCESS_DELETER_HPP