////////////////////////////////////////////////////////////////////////////// // // (C) Copyright Ion Gaztanaga 2006-2014. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/libs/interprocess for documentation. // ////////////////////////////////////////////////////////////////////////////// #ifndef ACTIV_BOOST_INTERPROCESS_UNIQUE_PTR_HPP_INCLUDED #define ACTIV_BOOST_INTERPROCESS_UNIQUE_PTR_HPP_INCLUDED #ifndef ACTIV_BOOST_CONFIG_HPP # include #endif # #if defined(ACTIV_BOOST_HAS_PRAGMA_ONCE) # pragma once #endif #include #include #include //!\file //!This header provides utilities to define a unique_ptr that plays nicely with managed segments. namespace Boost{ namespace interprocess{ //For backwards compatibility using ::Boost::movelib::unique_ptr; //!Returns the type of a unique pointer //!of type T with Boost::interprocess::deleter deleter //!that can be constructed in the given managed segment type. template struct managed_unique_ptr { typedef Boost::movelib::unique_ptr < T , typename ManagedMemory::template deleter::type > type; }; //!Returns an instance of a unique pointer constructed //!with Boost::interproces::deleter from a pointer //!of type T that has been allocated in the passed managed segment template inline typename managed_unique_ptr::type make_managed_unique_ptr(T *constructed_object, ManagedMemory &managed_memory) { return typename managed_unique_ptr::type (constructed_object, managed_memory.template get_deleter()); } } //namespace interprocess{ } //namespace Boost{ #include #endif //#ifndef ACTIV_BOOST_INTERPROCESS_UNIQUE_PTR_HPP_INCLUDED