|
Boost.PythonHeader <boost/python/default_call_policies.hpp> |
default_call_policies
default_call_policies
synopsis
default_call_policies
static functions
default_result_converter
default_result_converter
synopsis
default_result_converter
metafunctions
default_call_policies
default_call_policies
is a model of CallPolicies with no precall
or
postcall
behavior and a result_converter
which
handles by-value returns. Wrapped C++ functions and member functions use
default_call_policies
unless otherwise specified. You may find
it convenient to derive new models of CallPolicies from
default_call_policies
.
default_call_policies
synopsisnamespace boost { namespace python { struct default_call_policies { static bool precall(PyObject*); static PyObject* postcall(PyObject*, PyObject* result); typedef default_result_converter result_converter; }; }}
default_call_policies
static functionsbool precall(PyObject*);
true
PyObject* postcall(PyObject*, PyObject* result);
result
default_result_converter
default_result_converter
is a model of ResultConverterGenerator which can be
used to wrap C++ functions returning non-pointer types, char
const*
, and PyObject*
, by-value.
default_result_converter
synopsisnamespace boost { namespace python { struct default_result_converter { template <class T> struct apply; }; }}
default_result_converter
metafunctionstemplate <class T> struct apply
This example comes from the Boost.Python implementation itself. Because
the return_value_policy
class template does not implement precall
or
postcall
behavior, its default base class is
default_call_policies
:
template <class Handler, class Base = default_call_policies> struct return_value_policy : Base { typedef Handler result_converter; };
Revised 13 November, 2002
© Copyright Dave Abrahams 2002.