x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
arg_to_python.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\python\converter\arg_to_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 ARG_TO_PYTHON_DWA200265_HPP # define ARG_TO_PYTHON_DWA200265_HPP # include
# include
# include
# include
# include
# include
# include
// Bring in specializations # 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 function_arg_to_python : handle<> { function_arg_to_python(T const& x); }; template
struct reference_arg_to_python : handle<> { reference_arg_to_python(T& x); private: static PyObject* get_object(T& x); }; template
struct shared_ptr_arg_to_python : handle<> { shared_ptr_arg_to_python(T const& x); private: static PyObject* get_object(T& x); }; template
struct value_arg_to_python : arg_to_python_base { // Throw an exception if the conversion can't succeed value_arg_to_python(T const&); }; template
struct pointer_deep_arg_to_python : arg_to_python_base { // Throw an exception if the conversion can't succeed pointer_deep_arg_to_python(Ptr); }; template
struct pointer_shallow_arg_to_python : handle<> { // Throw an exception if the conversion can't succeed pointer_shallow_arg_to_python(Ptr); private: static PyObject* get_object(Ptr p); }; // Convert types that manage a Python object to_python template
struct object_manager_arg_to_python { object_manager_arg_to_python(T const& x) : m_src(x) {} PyObject* get() const { return python::upcast
(get_managed_object(m_src, tag)); } private: T const& m_src; }; template
struct select_arg_to_python { typedef typename unwrap_reference
::type unwrapped_referent; typedef typename unwrap_pointer
::type unwrapped_ptr; typedef typename mpl::if_< // Special handling for char const[N]; interpret them as char // const* for the sake of conversion python::detail::is_string_literal
, arg_to_python
, typename mpl::if_< python::detail::value_is_shared_ptr
, shared_ptr_arg_to_python
, typename mpl::if_< mpl::or_< is_function
, indirect_traits::is_pointer_to_function
, is_member_function_pointer
> , function_arg_to_python
, typename mpl::if_< is_object_manager
, object_manager_arg_to_python
, typename mpl::if_< is_pointer
, pointer_deep_arg_to_python
, typename mpl::if_< is_pointer_wrapper
, pointer_shallow_arg_to_python
, typename mpl::if_< is_reference_wrapper
, reference_arg_to_python
, value_arg_to_python
>::type >::type >::type >::type >::type >::type >::type type; }; } template
struct arg_to_python : detail::select_arg_to_python
::type { typedef typename detail::select_arg_to_python
::type base; public: // member functions // Throw an exception if the conversion can't succeed arg_to_python(T const& x); }; // // implementations // namespace detail { // reject_raw_object_ptr -- cause a compile-time error if the user // should pass a raw Python object pointer using python::detail::yes_convertible; using python::detail::no_convertible; using python::detail::unspecialized; template
struct cannot_convert_raw_PyObject; template
struct reject_raw_object_helper { static void error(Convertibility) { cannot_convert_raw_PyObject
::to_python_use_handle_instead(); } static void error(...) {} }; template
inline void reject_raw_object_ptr(T*) { reject_raw_object_helper
::error( python::detail::convertible
::check((T*)0)); typedef typename remove_cv
::type value_type; reject_raw_object_helper
::error( python::detail::convertible
::check( (base_type_traits
*)0 )); } // --------- template
inline function_arg_to_python
::function_arg_to_python(T const& x) : handle<>(python::objects::make_function_handle(x)) { } template
inline value_arg_to_python
::value_arg_to_python(T const& x) : arg_to_python_base(&x, registered
::converters) { } template
inline pointer_deep_arg_to_python
::pointer_deep_arg_to_python(Ptr x) : arg_to_python_base(x, registered_pointee
::converters) { detail::reject_raw_object_ptr((Ptr)0); } template
inline PyObject* reference_arg_to_python
::get_object(T& x) { to_python_indirect
convert; return convert(x); } template
inline reference_arg_to_python
::reference_arg_to_python(T& x) : handle<>(reference_arg_to_python
::get_object(x)) { } template
inline shared_ptr_arg_to_python
::shared_ptr_arg_to_python(T const& x) : handle<>(shared_ptr_to_python(x)) { } template
inline pointer_shallow_arg_to_python
::pointer_shallow_arg_to_python(Ptr x) : handle<>(pointer_shallow_arg_to_python
::get_object(x)) { detail::reject_raw_object_ptr((Ptr)0); } template
inline PyObject* pointer_shallow_arg_to_python
::get_object(Ptr x) { to_python_indirect
convert; return convert(x); } } template
inline arg_to_python
::arg_to_python(T const& x) : base(x) {} }}} // namespace boost::python::converter #endif // ARG_TO_PYTHON_DWA200265_HPP
arg_to_python.hpp
网页地址
文件地址
上一页
2/27
下一页
下载
( 7 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.