diff --git a/doc/v2/CallPolicies.html b/doc/v2/CallPolicies.html new file mode 100644 index 00000000..db358ec6 --- /dev/null +++ b/doc/v2/CallPolicies.html @@ -0,0 +1,103 @@ + + + + +Boost.Python - CallPolicies Concept + + + + + + + +
+

C++ Boost

+
+

Boost.Python

+

CallPolicies Concept

+
+
+
+
Introduction
+
Concept Requirements
+
+
CallPolicies Concept
+
+
+ +

Introduction

+ +

Models of the CallPolicies concept are used to specialize the +behavior of Python callable objects generated by Boost.Python to +wrapped C++ objects like function and member function +pointers, providing three behaviors: +

    +
  1. precall - Python argument tuple management before +the wrapped object is invoked +
  2. result_converter - C++ return value handling +
  3. postcall - Python argument tuple and result +management after the wrapped object is invoked +
+ +

Concept Requirements

+

CallPolicies Concept

+ +

In the table below, x denotes an object whose +type P is a model of CallPolicies, +a denotes a PyObject* pointing to +a Python argument tuple object, and r denotes a +PyObject* referring to a "preliminary" result +object. + + + + + + + + + + + + + + + +
ExpressionTypeResult/Semantics
x.precall(a)convertible to bool + returns false and PyErr_Occurred() != 0 + upon failure, true otherwise. + +
P::result_converterA model of ResultConverterGenerator. + An MPL unarymetafunction object used produce the + "preliminary" result object. + +
x.postcall(a, r)convertible to PyObject* + 0 0 and PyErr_Occurred() != 0 + upon failure. Must "conserve references" even in the + event of an exception. In other words, if r is not + returned, its reference count must be decremented; if another + existing object is returned, its reference count must be + incremented. +
+ +Models of CallPolicies are required to be CopyConstructible. + +


+

Revised + + 19 May, 2002 + +

+

© Copyright Dave + Abrahams 2002. All Rights Reserved. + +

Permission to copy, use, modify, sell + and distribute this software is granted provided this copyright notice appears + in all copies. This software is provided "as is" without express or implied + warranty, and with no claim as to its suitability for any purpose. + +