x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
to_python_value.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\python\to_python_value.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 TO_PYTHON_VALUE_DWA200221_HPP # define TO_PYTHON_VALUE_DWA200221_HPP # include
# include
# include
# include
# include
# include
# include
# include
# include
# include
# include
# include
# include
# include
# include
namespace boost { namespace python { namespace detail { #ifndef BOOST_PYTHON_NO_PY_SIGNATURES template
struct object_manager_get_pytype { template
static PyTypeObject const* get( U& (*)() =0) { return converter::object_manager_traits
::get_pytype(); } }; template <> struct object_manager_get_pytype
{ template
static PyTypeObject const* get( U const& (*)() =0) { return converter::object_manager_traits
::get_pytype(); } }; #endif template
struct object_manager_to_python_value { typedef typename value_arg
::type argument_type; PyObject* operator()(argument_type) const; #ifndef BOOST_PYTHON_NO_PY_SIGNATURES typedef boost::mpl::bool_
::value> is_t_handle; typedef boost::detail::indirect_traits::is_reference_to_const
is_t_const; PyTypeObject const* get_pytype() const { return get_pytype_aux((is_t_handle*)0); } inline static PyTypeObject const* get_pytype_aux(mpl::true_*) {return converter::object_manager_traits
::get_pytype();} inline static PyTypeObject const* get_pytype_aux(mpl::false_* ) { return object_manager_get_pytype
::get((T(*)())0); } #endif // This information helps make_getter() decide whether to try to // return an internal reference or not. I don't like it much, // but it will have to serve for now. BOOST_STATIC_CONSTANT(bool, uses_registry = false); }; template
struct registry_to_python_value { typedef typename value_arg
::type argument_type; PyObject* operator()(argument_type) const; #ifndef BOOST_PYTHON_NO_PY_SIGNATURES PyTypeObject const* get_pytype() const {return converter::registered
::converters.to_python_target_type();} #endif // This information helps make_getter() decide whether to try to // return an internal reference or not. I don't like it much, // but it will have to serve for now. BOOST_STATIC_CONSTANT(bool, uses_registry = true); }; template
struct shared_ptr_to_python_value { typedef typename value_arg
::type argument_type; PyObject* operator()(argument_type) const; #ifndef BOOST_PYTHON_NO_PY_SIGNATURES PyTypeObject const* get_pytype() const {return get_pytype((boost::type
*)0);} #endif // This information helps make_getter() decide whether to try to // return an internal reference or not. I don't like it much, // but it will have to serve for now. BOOST_STATIC_CONSTANT(bool, uses_registry = false); private: #ifndef BOOST_PYTHON_NO_PY_SIGNATURES template
PyTypeObject const* get_pytype(boost::type
&> *) const {return converter::registered
::converters.to_python_target_type();} template
PyTypeObject const* get_pytype(boost::type
&> *) const {return converter::registered
::converters.to_python_target_type();} #endif }; } template
struct to_python_value : mpl::if_< detail::value_is_shared_ptr
, detail::shared_ptr_to_python_value
, typename mpl::if_< mpl::or_< converter::is_object_manager
, converter::is_reference_to_object_manager
> , detail::object_manager_to_python_value
, detail::registry_to_python_value
>::type >::type { }; // // implementation // namespace detail { template
inline PyObject* registry_to_python_value
::operator()(argument_type x) const { typedef converter::registered
r; # if BOOST_WORKAROUND(__GNUC__, < 3) // suppresses an ICE, somehow (void)r::converters; # endif return converter::registered
::converters.to_python(&x); } template
inline PyObject* object_manager_to_python_value
::operator()(argument_type x) const { return python::upcast
( python::xincref( get_managed_object(x, tag)) ); } template
inline PyObject* shared_ptr_to_python_value
::operator()(argument_type x) const { return converter::shared_ptr_to_python(x); } } }} // namespace boost::python #endif // TO_PYTHON_VALUE_DWA200221_HPP
to_python_value.hpp
网页地址
文件地址
上一页
81/85
下一页
下载
( 5 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.