diff --git a/pyste/doc/pyste.txt b/pyste/doc/pyste.txt index 37d64dbf..8aa71f15 100644 --- a/pyste/doc/pyste.txt +++ b/pyste/doc/pyste.txt @@ -288,7 +288,7 @@ a python list of strings. Boost.Python has an excellent support for that: { list result; vector v = names(); - // put each string in the vector in the list + // put each string from the vector in the list return result; } @@ -328,7 +328,7 @@ Boost.Python: list names_wrapper(C* c) { - // same as before, calling c->names() and converting result to a list + // same as before, calling c->names() and converting result to a list } And then in the interface file: @@ -336,6 +336,13 @@ And then in the interface file: C = Class("C", "test.h") set_wrapper(C.names, "names_wrapper") +[blurb +[$theme/note.gif]Even though Boost.Python accepts either a pointer or a +reference to the class in wrappers for member functions as the first parameter, +Pyste expects them to be a [*pointer]. Doing otherwise will prevent your +code to compile when you set a wrapper for a virtual method. +] + [page:1 Exporting All Declarations from a Header] Pyste also supports a mechanism to export all declarations found in a header diff --git a/pyste/doc/wrappers.html b/pyste/doc/wrappers.html index 61bda6f8..e2e47052 100644 --- a/pyste/doc/wrappers.html +++ b/pyste/doc/wrappers.html @@ -38,7 +38,7 @@ Boost.Python has an excellent support for that:

{ list result; vector<string> v = names(); - // put each string in the vector in the list + // put each string from the vector in the list return result; } @@ -82,7 +82,7 @@ Boost.Python:

list names_wrapper(C* c) { - // same as before, calling c->names() and converting result to a list + // same as before, calling c->names() and converting result to a list }

@@ -91,6 +91,18 @@ And then in the interface file:

C = Class("C", "test.h") set_wrapper(C.names, "names_wrapper") + + + + +
+ +Even though +Boost.Python accepts either a pointer or a +reference to the class in wrappers for member functions as the first parameter, +Pyste expects them to be a pointer. Doing otherwise will prevent your +code to compile when you set a wrapper for a virtual method. +