123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287 |
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
- <title>Chapter 4. Function Invocation and Creation</title>
- <link rel="stylesheet" href="../boostbook.css" type="text/css">
- <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
- <link rel="home" href="index.html" title="Boost.Python Reference Manual">
- <link rel="up" href="index.html" title="Boost.Python Reference Manual">
- <link rel="prev" href="object_wrappers/boost_python_tuple_hpp.html" title="boost/python/tuple.hpp">
- <link rel="next" href="function_invocation_and_creation/boost_python_call_hpp.html" title="boost/python/call.hpp">
- </head>
- <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
- <table cellpadding="2" width="100%"><tr><td valign="top"><img alt="" width="" height="" src="../images/boost.png"></td></tr></table>
- <hr>
- <div class="spirit-nav">
- <a accesskey="p" href="object_wrappers/boost_python_tuple_hpp.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="function_invocation_and_creation/boost_python_call_hpp.html"><img src="../images/next.png" alt="Next"></a>
- </div>
- <div class="chapter">
- <div class="titlepage"><div><div><h1 class="title">
- <a name="function_invocation_and_creation"></a>Chapter 4. Function Invocation and Creation</h1></div></div></div>
- <div class="toc">
- <p><b>Table of Contents</b></p>
- <dl class="toc">
- <dt><span class="section"><a href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp">boost/python/args.hpp</a></span></dt>
- <dd><dl>
- <dt><span class="section"><a href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.introduction">Introduction</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.class_arg">Class
- <code class="computeroutput"><span class="identifier">arg</span></code></a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.class_arg_constructor">Class
- <code class="computeroutput"><span class="identifier">arg</span></code> constructor</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.class_arg_operator">Class
- <code class="computeroutput"><span class="identifier">arg</span></code> operator=</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.keyword_expression_operator">Keyword-expression
- operator,</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.example">Example</a></span></dt>
- </dl></dd>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_call_hpp.html">boost/python/call.hpp</a></span></dt>
- <dd><dl>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_call_hpp.html#function_invocation_and_creation.boost_python_call_hpp.introduction">Introduction</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_call_hpp.html#function_invocation_and_creation.boost_python_call_hpp.function_call">Function
- <code class="computeroutput"><span class="identifier">call</span></code></a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_call_hpp.html#function_invocation_and_creation.boost_python_call_hpp.example">Example</a></span></dt>
- </dl></dd>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_call_method_hpp.html">boost/python/call_method.hpp</a></span></dt>
- <dd><dl>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_call_method_hpp.html#function_invocation_and_creation.boost_python_call_method_hpp.introduction">Introduction</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_call_method_hpp.html#function_invocation_and_creation.boost_python_call_method_hpp.function_call_method">Function
- <code class="computeroutput"><span class="identifier">call_method</span></code></a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_call_method_hpp.html#function_invocation_and_creation.boost_python_call_method_hpp.example">Example</a></span></dt>
- </dl></dd>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_data_members_hpp.html">boost/python/data_members.hpp</a></span></dt>
- <dd><dl>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_data_members_hpp.html#function_invocation_and_creation.boost_python_data_members_hpp.introduction">Introduction</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_data_members_hpp.html#function_invocation_and_creation.boost_python_data_members_hpp.functions">Functions</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_data_members_hpp.html#function_invocation_and_creation.boost_python_data_members_hpp.example">Example</a></span></dt>
- </dl></dd>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_make_function_hpp.html">boost/python/make_function.hpp</a></span></dt>
- <dd><dl>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_make_function_hpp.html#function_invocation_and_creation.boost_python_make_function_hpp.introduction">Introduction</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_make_function_hpp.html#function_invocation_and_creation.boost_python_make_function_hpp.functions">Functions</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_make_function_hpp.html#function_invocation_and_creation.boost_python_make_function_hpp.example">Example</a></span></dt>
- </dl></dd>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_overloads_hpp.html">boost/python/overloads.hpp</a></span></dt>
- <dd><dl>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_overloads_hpp.html#function_invocation_and_creation.boost_python_overloads_hpp.introduction">Introduction</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_overloads_hpp.html#function_invocation_and_creation.boost_python_overloads_hpp.overloaddispatcher_concept">OverloadDispatcher
- Concept</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_overloads_hpp.html#function_invocation_and_creation.boost_python_overloads_hpp.macros">Macros</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_overloads_hpp.html#function_invocation_and_creation.boost_python_overloads_hpp.example">Example</a></span></dt>
- </dl></dd>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_ptr_hpp.html">boost/python/ptr.hpp</a></span></dt>
- <dd><dl>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_ptr_hpp.html#function_invocation_and_creation.boost_python_ptr_hpp.introduction">Introduction</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_ptr_hpp.html#function_invocation_and_creation.boost_python_ptr_hpp.functions">Functions</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_ptr_hpp.html#function_invocation_and_creation.boost_python_ptr_hpp.class_template_pointer_wrapper">Class
- template <code class="computeroutput"><span class="identifier">pointer_wrapper</span></code></a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_ptr_hpp.html#function_invocation_and_creation.boost_python_ptr_hpp.class_template_pointer_wrapper_t">Class
- template <code class="computeroutput"><span class="identifier">pointer_wrapper</span></code>
- types</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_ptr_hpp.html#function_invocation_and_creation.boost_python_ptr_hpp.class_template_pointer_wrapper_c">Class
- template <code class="computeroutput"><span class="identifier">pointer_wrapper</span></code>
- constructors and destructor</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_ptr_hpp.html#function_invocation_and_creation.boost_python_ptr_hpp.class_template_pointer_wrapper_o">Class
- template <code class="computeroutput"><span class="identifier">pointer_wrapper</span></code>
- observer functions</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_ptr_hpp.html#function_invocation_and_creation.boost_python_ptr_hpp.metafunctions">Metafunctions</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_ptr_hpp.html#function_invocation_and_creation.boost_python_ptr_hpp.example">Example</a></span></dt>
- </dl></dd>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_raw_function_hpp.html">boost/python/raw_function.hpp</a></span></dt>
- <dd><dl>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_raw_function_hpp.html#function_invocation_and_creation.boost_python_raw_function_hpp.introduction">Introduction</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_raw_function_hpp.html#function_invocation_and_creation.boost_python_raw_function_hpp.function_raw_function">Function
- <code class="computeroutput"><span class="identifier">raw_function</span></code></a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation/boost_python_raw_function_hpp.html#function_invocation_and_creation.boost_python_raw_function_hpp.example">Example</a></span></dt>
- </dl></dd>
- <dt><span class="section"><a href="function_invocation_and_creation/function_documentation.html">Function
- documentation</a></span></dt>
- <dd><dl>
- <dt><span class="section"><a href="function_invocation_and_creation/function_documentation.html#function_invocation_and_creation.function_documentation.boost_python_function_doc_signat">boost/python/function_doc_signature.hpp</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation/function_documentation.html#function_invocation_and_creation.function_documentation.boost_python_pytype_function_hpp">boost/python/pytype_function.hpp</a></span></dt>
- </dl></dd>
- <dt><span class="section"><a href="function_invocation_and_creation/models_of_callpolicies.html">Models
- of CallPolicies</a></span></dt>
- <dd><dl>
- <dt><span class="section"><a href="function_invocation_and_creation/models_of_callpolicies.html#function_invocation_and_creation.models_of_callpolicies.boost_python_default_call_polici">boost/python/default_call_policies.hpp</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation/models_of_callpolicies.html#function_invocation_and_creation.models_of_callpolicies.boost_python_return_arg_hpp">boost/python/return_arg.hpp</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation/models_of_callpolicies.html#function_invocation_and_creation.models_of_callpolicies.boost_python_return_internal_ref">boost/python/return_internal_reference.hpp</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation/models_of_callpolicies.html#function_invocation_and_creation.models_of_callpolicies.boost_python_return_value_policy">boost/python/return_value_policy.hpp</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation/models_of_callpolicies.html#function_invocation_and_creation.models_of_callpolicies.boost_python_with_custodian_and_">boost/python/with_custodian_and_ward.hpp</a></span></dt>
- </dl></dd>
- <dt><span class="section"><a href="function_invocation_and_creation/models_of_resultconverter.html">Models
- of ResultConverter</a></span></dt>
- <dd><dl>
- <dt><span class="section"><a href="function_invocation_and_creation/models_of_resultconverter.html#function_invocation_and_creation.models_of_resultconverter.boost_python_to_python_indirect_">boost/python/to_python_indirect.hpp</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation/models_of_resultconverter.html#function_invocation_and_creation.models_of_resultconverter.boost_python_to_python_value_hpp">boost/python/to_python_value.hpp</a></span></dt>
- </dl></dd>
- <dt><span class="section"><a href="function_invocation_and_creation/models_of_resultconvertergenerat.html">Models
- of ResultConverterGenerator</a></span></dt>
- <dd><dl>
- <dt><span class="section"><a href="function_invocation_and_creation/models_of_resultconvertergenerat.html#function_invocation_and_creation.models_of_resultconvertergenerat.boost_python_copy_const_referenc">boost/python/copy_const_reference.hpp</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation/models_of_resultconvertergenerat.html#function_invocation_and_creation.models_of_resultconvertergenerat.boost_python_copy_non_const_refe">boost/python/copy_non_const_reference.hpp</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation/models_of_resultconvertergenerat.html#function_invocation_and_creation.models_of_resultconvertergenerat.boost_python_manage_new_object_h">boost/python/manage_new_object.hpp</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation/models_of_resultconvertergenerat.html#function_invocation_and_creation.models_of_resultconvertergenerat.boost_python_reference_existing_">boost/python/reference_existing_object.hpp</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation/models_of_resultconvertergenerat.html#function_invocation_and_creation.models_of_resultconvertergenerat.boost_python_return_by_value_hpp">boost/python/return_by_value.hpp</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation/models_of_resultconvertergenerat.html#function_invocation_and_creation.models_of_resultconvertergenerat.boost_python_return_opaque_point">boost/python/return_opaque_pointer.hpp</a></span></dt>
- </dl></dd>
- </dl>
- </div>
- <div class="section">
- <div class="titlepage"><div><div><h2 class="title" style="clear: both">
- <a name="function_invocation_and_creation.boost_python_args_hpp"></a><a class="link" href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp" title="boost/python/args.hpp">boost/python/args.hpp</a>
- </h2></div></div></div>
- <div class="toc"><dl class="toc">
- <dt><span class="section"><a href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.introduction">Introduction</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.class_arg">Class
- <code class="computeroutput"><span class="identifier">arg</span></code></a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.class_arg_constructor">Class
- <code class="computeroutput"><span class="identifier">arg</span></code> constructor</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.class_arg_operator">Class
- <code class="computeroutput"><span class="identifier">arg</span></code> operator=</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.keyword_expression_operator">Keyword-expression
- operator,</a></span></dt>
- <dt><span class="section"><a href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.example">Example</a></span></dt>
- </dl></div>
- <div class="section">
- <div class="titlepage"><div><div><h3 class="title">
- <a name="function_invocation_and_creation.boost_python_args_hpp.introduction"></a><a class="link" href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.introduction" title="Introduction">Introduction</a>
- </h3></div></div></div>
- <div class="toc"><dl class="toc"><dt><span class="section"><a href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.introduction.keyword_expressions">keyword-expressions</a></span></dt></dl></div>
- <p>
- Supplies a family of overloaded functions for specifying argument keywords
- for wrapped C++ functions.
- </p>
- <div class="section">
- <div class="titlepage"><div><div><h4 class="title">
- <a name="function_invocation_and_creation.boost_python_args_hpp.introduction.keyword_expressions"></a><a class="link" href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.introduction.keyword_expressions" title="keyword-expressions">keyword-expressions</a>
- </h4></div></div></div>
- <p>
- A keyword-expression results in an object which holds a sequence of
- <a class="link" href="glossary.html#ntbs">ntbs</a>es, and whose type encodes the number
- of keywords specified. The keyword-expression may contain default values
- for some or all of the keywords it holds
- </p>
- </div>
- </div>
- <div class="section">
- <div class="titlepage"><div><div><h3 class="title">
- <a name="function_invocation_and_creation.boost_python_args_hpp.class_arg"></a><a class="link" href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.class_arg" title="Class arg">Class
- <code class="computeroutput"><span class="identifier">arg</span></code></a>
- </h3></div></div></div>
- <p>
- The objects of class arg are keyword-expressions holding one keyword (
- size one )
- </p>
- <pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">python</span>
- <span class="special">{</span>
- <span class="keyword">struct</span> <span class="identifier">arg</span>
- <span class="special">{</span>
- <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
- <span class="identifier">arg</span> <span class="special">&</span><span class="keyword">operator</span> <span class="special">=</span> <span class="special">(</span><span class="identifier">T</span> <span class="keyword">const</span> <span class="special">&</span><span class="identifier">value</span><span class="special">);</span>
- <span class="keyword">explicit</span> <span class="identifier">arg</span> <span class="special">(</span><span class="keyword">char</span> <span class="keyword">const</span> <span class="special">*</span><span class="identifier">name</span><span class="special">){</span><span class="identifier">elements</span><span class="special">[</span><span class="number">0</span><span class="special">].</span><span class="identifier">name</span> <span class="special">=</span> <span class="identifier">name</span><span class="special">;}</span>
- <span class="special">};</span>
- <span class="special">}}</span>
- </pre>
- </div>
- <div class="section">
- <div class="titlepage"><div><div><h3 class="title">
- <a name="function_invocation_and_creation.boost_python_args_hpp.class_arg_constructor"></a><a class="link" href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.class_arg_constructor" title="Class arg constructor">Class
- <code class="computeroutput"><span class="identifier">arg</span></code> constructor</a>
- </h3></div></div></div>
- <pre class="programlisting"><span class="identifier">arg</span><span class="special">(</span><span class="keyword">char</span> <span class="keyword">const</span><span class="special">*</span> <span class="identifier">name</span><span class="special">);</span></pre>
- <div class="variablelist">
- <p class="title"><b></b></p>
- <dl class="variablelist">
- <dt><span class="term">Requires</span></dt>
- <dd><p>
- The argument must be a <a class="link" href="glossary.html#ntbs">ntbs</a>.
- </p></dd>
- <dt><span class="term">Effects</span></dt>
- <dd><p>
- Constructs an arg object holding a keyword with name name.
- </p></dd>
- </dl>
- </div>
- </div>
- <div class="section">
- <div class="titlepage"><div><div><h3 class="title">
- <a name="function_invocation_and_creation.boost_python_args_hpp.class_arg_operator"></a><a class="link" href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.class_arg_operator" title="Class arg operator=">Class
- <code class="computeroutput"><span class="identifier">arg</span></code> operator=</a>
- </h3></div></div></div>
- <pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="identifier">arg</span> <span class="special">&</span><span class="keyword">operator</span> <span class="special">=</span> <span class="special">(</span><span class="identifier">T</span> <span class="keyword">const</span> <span class="special">&</span><span class="identifier">value</span><span class="special">);</span></pre>
- <div class="variablelist">
- <p class="title"><b></b></p>
- <dl class="variablelist">
- <dt><span class="term">Requires</span></dt>
- <dd><p>
- The argument must convertible to python.
- </p></dd>
- <dt><span class="term">Effects</span></dt>
- <dd><p>
- Assigns default value for the keyword.
- </p></dd>
- <dt><span class="term">Returns</span></dt>
- <dd><p>
- Reference to <code class="computeroutput"><span class="keyword">this</span></code>.
- </p></dd>
- </dl>
- </div>
- </div>
- <div class="section">
- <div class="titlepage"><div><div><h3 class="title">
- <a name="function_invocation_and_creation.boost_python_args_hpp.keyword_expression_operator"></a><a class="link" href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.keyword_expression_operator" title="Keyword-expression operator,">Keyword-expression
- operator,</a>
- </h3></div></div></div>
- <pre class="programlisting"><span class="identifier">keyword</span><span class="special">-</span><span class="identifier">expression</span> <span class="keyword">operator</span> <span class="special">,</span> <span class="special">(</span><span class="identifier">keyword</span><span class="special">-</span><span class="identifier">expression</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">arg</span> <span class="special">&</span><span class="identifier">kw</span><span class="special">)</span> <span class="keyword">const</span>
- <span class="identifier">keyword</span><span class="special">-</span><span class="identifier">expression</span> <span class="keyword">operator</span> <span class="special">,</span> <span class="special">(</span><span class="identifier">keyword</span><span class="special">-</span><span class="identifier">expression</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span><span class="identifier">name</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
- </pre>
- <div class="variablelist">
- <p class="title"><b></b></p>
- <dl class="variablelist">
- <dt><span class="term">Requires</span></dt>
- <dd><p>
- The argument name must be a <a class="link" href="glossary.html#ntbs">ntbs</a>.
- </p></dd>
- <dt><span class="term">Effects</span></dt>
- <dd><p>
- Extends the keyword-expression argument with one more keyword.
- </p></dd>
- <dt><span class="term">Returns</span></dt>
- <dd><p>
- The extended keyword-expression.
- </p></dd>
- </dl>
- </div>
- </div>
- <div class="section">
- <div class="titlepage"><div><div><h3 class="title">
- <a name="function_invocation_and_creation.boost_python_args_hpp.example"></a><a class="link" href="function_invocation_and_creation.html#function_invocation_and_creation.boost_python_args_hpp.example" title="Example">Example</a>
- </h3></div></div></div>
- <pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">python</span><span class="special">/</span><span class="identifier">def</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
- <span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">python</span><span class="special">;</span>
- <span class="keyword">int</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">double</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">double</span> <span class="identifier">y</span><span class="special">,</span> <span class="keyword">double</span> <span class="identifier">z</span><span class="special">=</span><span class="number">0.0</span><span class="special">,</span> <span class="keyword">double</span> <span class="identifier">w</span><span class="special">=</span><span class="number">1.0</span><span class="special">);</span>
- <span class="identifier">BOOST_PYTHON_MODULE</span><span class="special">(</span><span class="identifier">xxx</span><span class="special">)</span>
- <span class="special">{</span>
- <span class="identifier">def</span><span class="special">(</span><span class="string">"f"</span><span class="special">,</span> <span class="identifier">f</span><span class="special">,</span> <span class="special">(</span><span class="identifier">arg</span><span class="special">(</span><span class="string">"x"</span><span class="special">),</span> <span class="string">"y"</span><span class="special">,</span> <span class="identifier">arg</span><span class="special">(</span><span class="string">"z"</span><span class="special">)=</span><span class="number">0.0</span><span class="special">,</span> <span class="identifier">arg</span><span class="special">(</span><span class="string">"w"</span><span class="special">)=</span><span class="number">1.0</span><span class="special">));</span>
- <span class="special">}</span>
- </pre>
- </div>
- </div>
- </div>
- <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
- <td align="left"></td>
- <td align="right"><div class="copyright-footer">Copyright © 2002-2005, 2015 David Abrahams, Stefan Seefeld<p>
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>
- </p>
- </div></td>
- </tr></table>
- <hr>
- <div class="spirit-nav">
- <a accesskey="p" href="object_wrappers/boost_python_tuple_hpp.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="function_invocation_and_creation/boost_python_call_hpp.html"><img src="../images/next.png" alt="Next"></a>
- </div>
- </body>
- </html>
|