x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
return_from_python.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\python\converter\return_from_python.hpp
旋转
特效
属性
历史版本
// Copyright David Abrahams 2002. // 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) #ifndef RETURN_FROM_PYTHON_DWA200265_HPP # define RETURN_FROM_PYTHON_DWA200265_HPP # include
# include
# include
# include
# include
# include
# include
# include
# include
# include
# include
# include
namespace boost { namespace python { namespace converter { template
struct is_object_manager; namespace detail { template
struct return_pointer_from_python { typedef T result_type; T operator()(PyObject*) const; }; template
struct return_reference_from_python { typedef T result_type; T operator()(PyObject*) const; }; template
struct return_rvalue_from_python { typedef T result_type; return_rvalue_from_python(); result_type operator()(PyObject*); private: rvalue_from_python_data
m_data; }; template
struct return_object_manager_from_python { typedef T result_type; result_type operator()(PyObject*) const; }; template
struct select_return_from_python { BOOST_STATIC_CONSTANT( bool, obj_mgr = is_object_manager
::value); BOOST_STATIC_CONSTANT( bool, ptr = is_pointer
::value); BOOST_STATIC_CONSTANT( bool, ref = is_reference
::value); typedef typename mpl::if_c< obj_mgr , return_object_manager_from_python
, typename mpl::if_c< ptr , return_pointer_from_python
, typename mpl::if_c< ref , return_reference_from_python
, return_rvalue_from_python
>::type >::type >::type type; }; } template
struct return_from_python : detail::select_return_from_python
::type { }; // Specialization as a convenience for call and call_method template <> struct return_from_python
{ typedef python::detail::returnable
::type result_type; result_type operator()(PyObject* x) const { (void_result_from_python)(x); # ifdef BOOST_NO_VOID_RETURNS return result_type(); # endif } }; // // Implementations // namespace detail { template
inline return_rvalue_from_python
::return_rvalue_from_python() : m_data( const_cast
(®istered
::converters) ) { } template
inline typename return_rvalue_from_python
::result_type return_rvalue_from_python
::operator()(PyObject* obj) { // Take possession of the source object here. If the result is in // fact going to be a copy of an lvalue embedded in the object, // and we take possession inside rvalue_result_from_python, it // will be destroyed too early. handle<> holder(obj); return *(T*) (rvalue_result_from_python)(obj, m_data.stage1); } template
inline T return_reference_from_python
::operator()(PyObject* obj) const { return python::detail::void_ptr_to_reference( (reference_result_from_python)(obj, registered
::converters) , (T(*)())0); } template
inline T return_pointer_from_python
::operator()(PyObject* obj) const { return T( (pointer_result_from_python)(obj, registered_pointee
::converters) ); } template
inline T return_object_manager_from_python
::operator()(PyObject* obj) const { return T( object_manager_traits
::adopt(expect_non_null(obj)) ); } } }}} // namespace boost::python::converter #endif // RETURN_FROM_PYTHON_DWA200265_HPP
return_from_python.hpp
网页地址
文件地址
上一页
22/27
下一页
下载
( 4 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.