From 09046c53ef12f19f779265ae467bf58358e7d987 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Fri, 10 May 2002 04:00:33 +0000 Subject: [PATCH] ResultConverter/ResultConverterGenerator [SVN r13793] --- doc/v2/ResultConverter.html | 110 ++++++++++++++++++++++++++ doc/v2/copy_const_reference.html | 2 +- doc/v2/copy_non_const_reference.html | 2 +- doc/v2/default_call_policies.html | 2 +- doc/v2/manage_new_object.html | 2 +- doc/v2/reference.html | 12 ++- doc/v2/reference_existing_object.html | 2 +- doc/v2/return_value_policy.html | 4 +- doc/v2/to_python_indirect.html | 4 +- 9 files changed, 130 insertions(+), 10 deletions(-) create mode 100644 doc/v2/ResultConverter.html diff --git a/doc/v2/ResultConverter.html b/doc/v2/ResultConverter.html new file mode 100644 index 00000000..08d81b1a --- /dev/null +++ b/doc/v2/ResultConverter.html @@ -0,0 +1,110 @@ + + + + +Boost.Python - ResultConverter Concept + + + + + + + +
+

C++ Boost

+
+

Boost.Python

+

ResultConverter Concept

+
+
+
+
Introduction
+
Concept Requirements
+
+
ResultConverter Concept
+
ResultConverterGenerator Concept
+
+
+ +

Introduction

+ +

A ResultConverter for a type T is a type whose +instances can be used to convert C++ return values of type +T to_python. A ResultConverterGenerator is +an MPL unary metafunction class which, given the return type of a C++ +function, returns a ResultConverter for that type. ResultConverters in +Boost.Python generally inspect library's registry of converters to +find a suitable converter, but converters which don't use the registry +are also possible. + +

Concept Requirements

+

ResultConverter Concept

+ +

In the table below, C denotes a ResultConverter +type for a type R , c denotes +an object of type C , and r +denotes an object of type R. + + + + + + + + + + + + + + + + + + + + + + + + +
ExpressionTypeSemantics
C c; + Constructs a C object. +
c.convertible()convertible to boolfalse iff no conversion from any R value + to a Python object is possible.
c(r)convertible to PyObject*A pointer to a Python object corresponding to r, + or 0 iff r could not be converted + to_python, in which case PyErr_Occurred + should return non-zero.
+ +

ResultConverterGenerator Concept

+

In the table below, G denotes a +ResultConverterGenerator type and R denotes a possible +C++ function return type. + + + + + + + + + +
ExpressionRequirements
G::apply<R>::typeA ResultConverter type for R.
+ +


+

Revised + + 09 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. + + diff --git a/doc/v2/copy_const_reference.html b/doc/v2/copy_const_reference.html index ec76fa1a..70da135b 100644 --- a/doc/v2/copy_const_reference.html +++ b/doc/v2/copy_const_reference.html @@ -50,7 +50,7 @@ copy_const_reference

copy_const_reference is a model of ResultConverterGenerator which can be + "ResultConverter.html#ResultConverterGenerator-concept">ResultConverterGenerator which can be used to wrap C++ functions returning a reference-to-const type such that the referenced value is copied into a new Python object. diff --git a/doc/v2/copy_non_const_reference.html b/doc/v2/copy_non_const_reference.html index a33bba55..ffa728db 100644 --- a/doc/v2/copy_non_const_reference.html +++ b/doc/v2/copy_non_const_reference.html @@ -51,7 +51,7 @@ copy_non_const_reference

copy_non_const_reference is a model of ResultConverterGenerator which can be + "ResultConverter.html#ResultConverterGenerator-concept">ResultConverterGenerator which can be used to wrap C++ functions returning a reference-to-non-const type such that the referenced value is copied into a new Python object. diff --git a/doc/v2/default_call_policies.html b/doc/v2/default_call_policies.html index 876baf7a..058b13e2 100644 --- a/doc/v2/default_call_policies.html +++ b/doc/v2/default_call_policies.html @@ -111,7 +111,7 @@ PyObject* postcall(PyObject*, PyObject* result); default_result_converter

default_result_converter is a model of ResultConverterGenerator which can be + "ResultConverter.html#ResultConverterGenerator-concept">ResultConverterGenerator which can be used to wrap C++ functions returning non-pointer types, char const*, and PyObject*, by-value. diff --git a/doc/v2/manage_new_object.html b/doc/v2/manage_new_object.html index 342c49ce..879cdc5e 100644 --- a/doc/v2/manage_new_object.html +++ b/doc/v2/manage_new_object.html @@ -50,7 +50,7 @@ manage_new_object

manage_new_object is a model of ResultConverterGenerator which can be + "ResultConverter.html#ResultConverterGenerator-concept">ResultConverterGenerator which can be used to wrap C++ functions which return a pointer to an object allocated with a new-expression, and expect the caller to take responsibility for deleting that object. diff --git a/doc/v2/reference.html b/doc/v2/reference.html index 335382a6..24efbf61 100644 --- a/doc/v2/reference.html +++ b/doc/v2/reference.html @@ -164,8 +164,18 @@ -

reference.hpp +
pointee.hpp +
+
+
Classes +
+
+
class template pointee +
+
+ +
reference.hpp
Classes diff --git a/doc/v2/reference_existing_object.html b/doc/v2/reference_existing_object.html index e7668a18..dbb7a983 100644 --- a/doc/v2/reference_existing_object.html +++ b/doc/v2/reference_existing_object.html @@ -51,7 +51,7 @@ reference_existing_object

reference_existing_object is a model of ResultConverterGenerator which can be + "ResultConverter.html#ResultConverterGenerator-concept">ResultConverterGenerator which can be used to wrap C++ functions which return a reference or pointer to a C++ object. When the wrapped function is called, the value referenced by its return value is not copied. A new Python object is created which contains a diff --git a/doc/v2/return_value_policy.html b/doc/v2/return_value_policy.html index f351af70..950b024b 100644 --- a/doc/v2/return_value_policy.html +++ b/doc/v2/return_value_policy.html @@ -49,7 +49,7 @@ return_value_policy instantiations are simply models of CallPolicies which are composed of a ResultConverterGenerator and optional Base ResultConverterGenerator and optional Base CallPolicies.

Classes

@@ -69,7 +69,7 @@ Default - ResultConverterGenerator + ResultConverterGenerator A model of ResultConverterGenerator. diff --git a/doc/v2/to_python_indirect.html b/doc/v2/to_python_indirect.html index 8910cd97..d0b82f70 100644 --- a/doc/v2/to_python_indirect.html +++ b/doc/v2/to_python_indirect.html @@ -107,7 +107,7 @@ of its first argument type to python as extension class instances, using the own Instantiations of to_python_indirect are models of ResultConverter. + href="ResultConverter.html#ResultConverter-concept">ResultConverter.

Class template to_python_indirect synopsis

@@ -174,7 +174,7 @@ struct make_reference_holder struct reference_existing_object { - // metafunction returning the ResultConverter + // metafunction returning the ResultConverter template <class T> struct apply {