x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
sp_counted_impl.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\interprocess\smart_ptr\detail\sp_counted_impl.hpp
旋转
特效
属性
历史版本
#ifndef BOOST_INTERPROCESS_DETAIL_SP_COUNTED_IMPL_HPP_INCLUDED #define BOOST_INTERPROCESS_DETAIL_SP_COUNTED_IMPL_HPP_INCLUDED // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif // // This file is the adaptation for shared memory memory mapped // files of boost/detail/sp_counted_impl.hpp // // Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd. // Copyright 2004-2005 Peter Dimov // Copyright 2006 Ion Gaztanaga // // 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) // #include
#include
#include
#include
#include
namespace boost { namespace interprocess { namespace detail { template
class sp_counted_impl_pd : public sp_counted_base , A::template rebind< sp_counted_impl_pd
>::other , D // copy constructor must not throw { private: typedef sp_counted_impl_pd
this_type; typedef typename A::template rebind
::other this_allocator; typedef typename A::template rebind
::other const_this_allocator; typedef typename this_allocator::pointer this_pointer; sp_counted_impl_pd( sp_counted_impl_pd const & ); sp_counted_impl_pd & operator= ( sp_counted_impl_pd const & ); typedef typename detail::pointer_to_other
::type const_deleter_pointer; typedef typename detail::pointer_to_other
::type const_allocator_pointer; typedef typename D::pointer pointer; pointer m_ptr; public: // pre: d(p) must not throw template
sp_counted_impl_pd(const Ptr & p, const A &a, const D &d ) : this_allocator(a), D(d), m_ptr(p) {} const_deleter_pointer get_deleter() const { return const_deleter_pointer(&static_cast
(*this)); } const_allocator_pointer get_allocator() const { return const_allocator_pointer(&static_cast
(*this)); } void dispose() // nothrow { static_cast
(*this)(m_ptr); } void destroy() // nothrow { //Self destruction, so get a copy of the allocator //(in the future we could move it) this_allocator a_copy(*this); BOOST_ASSERT(a_copy == *this); this_pointer this_ptr (this); //Do it now! scoped_ptr
>(this_ptr, a_copy); typedef typename this_allocator::value_type value_type; detail::get_pointer(this_ptr)->~value_type(); } void release() // nothrow { if(this->ref_release()){ this->dispose(); this->weak_release(); } } void weak_release() // nothrow { if(sp_counted_base::weak_release()){ this->destroy(); } } }; } // namespace detail } // namespace interprocess } // namespace boost #include
#endif // #ifndef BOOST_INTERPROCESS_DETAIL_SP_COUNTED_IMPL_HPP_INCLUDED
sp_counted_impl.hpp
网页地址
文件地址
上一页
5/5 下一页
下载
( 3 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.