diff --git a/doc/v2/call_method.html b/doc/v2/call_method.html index 5323ab07..e5cf7e6b 100644 --- a/doc/v2/call_method.html +++ b/doc/v2/call_method.html @@ -121,7 +121,7 @@ class Base_callback : public Base using namespace boost::python; BOOST_PYTHON_MODULE_INIT(my_module) { - def("is_base", is_base) + def("is_base", is_base); class_<Base,Base_callback, noncopyable>("Base") .def("class_name", &Base_callback::Base_name) diff --git a/doc/v2/implicit.html b/doc/v2/implicit.html index 03832566..aebe2b52 100644 --- a/doc/v2/implicit.html +++ b/doc/v2/implicit.html @@ -123,8 +123,8 @@ X make_x(int n) { return X(n); } BOOST_PYTHON_MODULE_INIT(implicit_ext) { - def("x_value", x_value) - def("make_x", make_x) + def("x_value", x_value); + def("make_x", make_x); class_<X>("X", init<int>()) diff --git a/doc/v2/lvalue_from_pytype.html b/doc/v2/lvalue_from_pytype.html index 8b3cb49e..57997b3a 100755 --- a/doc/v2/lvalue_from_pytype.html +++ b/doc/v2/lvalue_from_pytype.html @@ -1,128 +1,145 @@ - + + +
+|
- |
Boost.Python-Header <boost/python/lvalue_from_pytype.hpp>+Header + <boost/python/lvalue_from_pytype.hpp>+ |
+
lvalue_from_pytype
+ lvalue_from_pytypelvalue_from_pytype synopsis
+ lvalue_from_pytype synopsislvalue_from_pytype constructor
+ lvalue_from_pytype constructorextract_identity
+ extract_identityextract_identity synopsis
+ extract_identity synopsisextract_identity static functions
+ extract_identity static functionsextract_member
+ extract_memberextract_member synopsis
+ extract_member synopsisextract_member static functions
+ extract_member static functions<boost/python/lvalue_from_pytype.hpp> supplies
- a facility for extracting C++ objects from within Python instances
- of a given type. This is typically useful for dealing with
- "traditional" Python extension types.
+ <boost/python/lvalue_from_pytype.hpp> supplies a
+ facility for extracting C++ objects from within Python instances of a
+ given type. This is typically useful for dealing with "traditional"
+ Python extension types.
lvalue_from_pytypelvalue_from_pytypeClass template lvalue_from_pytype will register
- from_python converters which, given an object of the given Python
- type, can extract references and pointers to a particular C++
- type. Its template arguments are:
-
-
- + from_python converters which, given an object of the given Python type, + can extract references and pointers to a particular C++ type. Its + template arguments are:
| Parameter - - | Requirements - - | Semantics | |||
|---|---|---|---|---|---|
Extractor
+ | Parameter | -a model of Extractor whose - execute function returns a reference type. + | Requirements | -Extracts the lvalue from the Python object once its type has been confirmed + | Semantics | +
python_type
+ | Extractor |
- A compile-time constant PyTypeObject*
+ | a model of Extractor whose execute + function returns a reference type. | -The Python type of instances convertible by this - converter. Python subtypes are also convertible. + | Extracts the lvalue from the Python object once its type has been + confirmed | +
python_type |
+
+ A compile-time constant PyTypeObject* |
+
+ The Python type of instances convertible by this converter. + Python subtypes are also convertible. | +
lvalue_from_pytype synopsislvalue_from_pytype synopsis
namespace boost { namespace python
{
@@ -134,25 +151,25 @@ namespace boost { namespace python
}}
- lvalue_from_pytype constructorlvalue_from_pytype constructorlvalue_from_pytype();
Extractor::execute.
-
+ Extractor::execute.extract_identityextract_identityextract_identity is a model of Extractor which can be
- used in the common case where the C++ type to be extracted is the
- same as the Python object type.
+
extract_identity is a model of Extractor which can be used in the
+ common case where the C++ type to be extracted is the same as the Python
+ object type.
extract_identity synopsisextract_identity static functionsextract_identity static functionsInstanceType& execute(InstanceType& c);
c
-
+ cextract_memberextract_memberextract_member is a model of Extractor which can be used in the
+ common case in the common case where the C++ type to be extracted is a
+ member of the Python object.
extract_member is a model of Extractor which can be
- used in the common case in the common case where the C++
- type to be extracted is a member of the Python object.
-
-
extract_member synopsisextract_member synopsis
namespace boost { namespace python
{
@@ -198,34 +215,31 @@ namespace boost { namespace python
}}
- extract_member static functionsextract_member static functionsstatic MemberType& execute(InstanceType& c);
c.*member
-
+ c.*memberNoddys. Since
+ noddy_NoddyObject is so simple that it carries no
+ interesting information, the example is a bit contrived: it assumes you
+ want to keep track of one particular object for some reason. This module
+ would have to be dynamically linked to the module which defines
+ noddy_NoddyType.
-This example presumes that someone has implemented the standard noddy
-example module from the Python documentation, and we want to build
-a module which manipulates Noddys. Since
-noddy_NoddyObject is so simple that it carries no
-interesting information, the example is a bit contrived: it assumes
-you want to keep track of one particular object for some reason. This
-module would have to be dynamically linked to the module which defines
-noddy_NoddyType.
-
-
#include <boost/python/reference.hpp>
-#include <boost/python/module.hpp>
+#include <boost/python/module_init.hpp>
// definition lifted from the Python docs
typedef struct {
@@ -247,18 +261,15 @@ void set_cache(noddy_NoddyObject* x)
BOOST_PYTHON_MODULE_INIT(noddy_cache)
{
- module noddy_cache("noddy_cache")
- .def("is_cached", is_cached)
- .def("set_cache", set_cache)
- ;
+ def("is_cached", is_cached);
+ def("set_cache", set_cache);
// register Noddy lvalue converter
lvalue_from_pytype<extract_identity<noddy_NoddyObject>,&noddy_NoddyType>();
}
-
>>> import noddy
>>> n = noddy.new_noddy()
@@ -274,10 +285,13 @@ BOOST_PYTHON_MODULE_INIT(noddy_cache)
Revised
- 05 November, 2001
+ 29 September, 2001
+
-
- © Copyright Dave
- Abrahams 2002. All Rights Reserved.
+
© Copyright Dave Abrahams 2002. All Rights
+ Reserved.
+
+