Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

b'\n \n \n \n\n Boost.Python -\n <boost/python/default_call_policies.hpp>\n\n \n \n
\n

\n

\n\n
\n

Boost.Python

\n\n

Header\n <boost/python/default_call_policies.hpp>

\n
\n
\n\n

Contents

\n\n
\n
Classes\n\n
\n
\n
Class\n default_call_policies\n\n
\n
\n
Class\n default_call_policies synopsis\n\n
Class\n default_call_policies static functions\n
\n\n
Class\n default_result_converter\n\n
\n
\n
Class\n default_result_converter synopsis\n\n
Class\n default_result_converter metafunctions\n
\n
\n\n
Example\n
\n
\n\n

Classes

\n\n

Class\n default_call_policies

\n\n

default_call_policies is a model of CallPolicies with no precall or\n postcall behavior and a result_converter which\n handles by-value returns. Wrapped C++ functions and member functions use\n default_call_policies unless otherwise specified. You may find\n it convenient to derive new models of CallPolicies from\n default_call_policies.\n\n

Class\n default_call_policies synopsis

\n
\nnamespace boost { namespace python\n{\n    struct default_call_policies\n    {\n        static bool precall(PyObject*);\n        static PyObject* postcall(PyObject*, PyObject* result);\n        typedef default_result_converter result_converter;\n        template <class Sig> struct extract_return_type : mpl::front<Sig>{};\n    };\n}}\n
\n\n

Class\n default_call_policies static functions

\n
\nbool precall(PyObject*);\n
\n\n
\n
Returns: true\n\n
Throws: nothing\n
\n
\nPyObject* postcall(PyObject*, PyObject* result);\n
\n\n
\n
Returns: result\n\n
Throws: nothing\n
\n\n

Class\n default_result_converter

\n\n

default_result_converter is a model of ResultConverterGenerator which can be\n used to wrap C++ functions returning non-pointer types, char\n const*, and PyObject*, by-value.\n\n

Class\n default_result_converter synopsis

\n
\nnamespace boost { namespace python\n{\n    struct default_result_converter\n    {\n        template <class T> struct apply;\n    };\n}}\n
\n\n

Class\n default_result_converter metafunctions

\n
\ntemplate <class T> struct apply\n
\n\n
\n
Requires: T is not a reference type. If\n T is a pointer type, T is const\n char* or PyObject*.\n\n
Returns: typedef to_python_value<T\n const&> type;\n
\n\n

Example

\n\n

This example comes from the Boost.Python implementation itself. Because\n the return_value_policy\n class template does not implement precall or\n postcall behavior, its default base class is\n default_call_policies:\n

\ntemplate <class Handler, class Base = default_call_policies>\nstruct return_value_policy : Base\n{\n   typedef Handler result_converter;\n};\n
\n\n

Revised \n \n 11 June, 2007\n \n\n\n

© Copyright Dave\n Abrahams 2002. Distributed under the Boost Software License,\n Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at\n http://www.boost.org/LICENSE_1_0.txt)

\n\n'