x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
make_function.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\python\make_function.hpp
旋转
特效
属性
历史版本
// Copyright David Abrahams 2001. // 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 MAKE_FUNCTION_DWA20011221_HPP # define MAKE_FUNCTION_DWA20011221_HPP # include
# include
# include
# include
# include
# include
# include
namespace boost { namespace python { namespace detail { // make_function_aux -- // // These helper functions for make_function (below) do the raw work // of constructing a Python object from some invokable entity. See //
for more information about how // the Sig arguments is used. template
object make_function_aux( F f // An object that can be invoked by detail::invoke() , CallPolicies const& p // CallPolicies to use in the invocation , Sig const& // An MPL sequence of argument types expected by F ) { return objects::function_object( detail::caller
(f, p) ); } // As above, except that it accepts argument keywords. NumKeywords // is used only for a compile-time assertion to make sure the user // doesn't pass more keywords than the function can accept. To // disable all checking, pass mpl::int_<0> for NumKeywords. template
object make_function_aux( F f , CallPolicies const& p , Sig const& , detail::keyword_range const& kw // a [begin,end) pair of iterators over keyword names , NumKeywords // An MPL integral type wrapper: the size of kw ) { enum { arity = mpl::size
::value - 1 }; typedef typename detail::error::more_keywords_than_function_arguments< NumKeywords::value, arity >::too_many_keywords assertion; return objects::function_object( detail::caller
(f, p) , kw); } // Helpers for make_function when called with 3 arguments. These // dispatch functions are used to discriminate between the cases // when the 3rd argument is keywords or when it is a signature. // // @group { template
object make_function_dispatch(F f, CallPolicies const& policies, Keywords const& kw, mpl::true_) { return detail::make_function_aux( f , policies , detail::get_signature(f) , kw.range() , mpl::int_
() ); } template
object make_function_dispatch(F f, CallPolicies const& policies, Signature const& sig, mpl::false_) { return detail::make_function_aux( f , policies , sig ); } // } } // These overloaded functions wrap a function or member function // pointer as a Python object, using optional CallPolicies, // Keywords, and/or Signature. // // @group { template
object make_function(F f) { return detail::make_function_aux( f,default_call_policies(), detail::get_signature(f)); } template
object make_function(F f, CallPolicies const& policies) { return detail::make_function_aux( f, policies, detail::get_signature(f)); } template
object make_function( F f , CallPolicies const& policies , KeywordsOrSignature const& keywords_or_signature) { typedef typename detail::is_reference_to_keywords
::type is_kw; return detail::make_function_dispatch( f , policies , keywords_or_signature , is_kw() ); } template
object make_function( F f , CallPolicies const& policies , Keywords const& kw , Signature const& sig ) { return detail::make_function_aux( f , policies , sig , kw.range() , mpl::int_
() ); } // } }} #endif // MAKE_FUNCTION_DWA20011221_HPP
make_function.hpp
网页地址
文件地址
上一页
38/85
下一页
下载
( 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.