Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // (C) Copyright Ion Gaztanaga 2007-2012. Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. Chris@16: // (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: // See http://www.boost.org/libs/interprocess for documentation. Chris@16: // Chris@16: ////////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: #ifndef BOOST_INTERPROCESS_DELETER_HPP Chris@16: #define BOOST_INTERPROCESS_DELETER_HPP Chris@16: Chris@101: #ifndef BOOST_CONFIG_HPP Chris@101: # include Chris@101: #endif Chris@101: # Chris@101: #if defined(BOOST_HAS_PRAGMA_ONCE) Chris@16: # pragma once Chris@16: #endif Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: //!\file Chris@16: //!Describes the functor to delete objects from the segment. Chris@16: Chris@16: namespace boost { Chris@16: namespace interprocess { Chris@16: Chris@16: //!A deleter that uses the segment manager's destroy_ptr Chris@16: //!function to destroy the passed pointer resource. Chris@16: //! Chris@16: //!This deleter is used Chris@16: template Chris@16: class deleter Chris@16: { Chris@16: public: Chris@16: typedef typename boost::intrusive:: Chris@16: pointer_traits::template Chris@16: rebind_pointer::type pointer; Chris@16: Chris@16: private: Chris@16: typedef typename boost::intrusive:: Chris@16: pointer_traits::template Chris@16: rebind_pointer::type segment_manager_pointer; Chris@16: Chris@16: segment_manager_pointer mp_mngr; Chris@16: Chris@16: public: Chris@16: deleter(segment_manager_pointer pmngr) Chris@16: : mp_mngr(pmngr) Chris@16: {} Chris@16: Chris@16: void operator()(const pointer &p) Chris@16: { mp_mngr->destroy_ptr(ipcdetail::to_raw_pointer(p)); } Chris@16: }; Chris@16: Chris@16: } //namespace interprocess { Chris@16: } //namespace boost { Chris@16: Chris@16: #include Chris@16: Chris@16: #endif //#ifndef BOOST_INTERPROCESS_DELETER_HPP