Boost logo

Boost :

From: rwgk_at_[hidden]
Date: 2001-01-27 12:42:38


I have created a named CVS branch "ralf_grosse_kunstleve" and checked
in my changes for the support of exporting/importing class wrappers in
the Boost Python Library.

The changes implement three new user-level features that make it
possible to distribute BPL class wrappers for interdependent C++
classes over several extension modules:

To build a class wrapper that also exports the to/from_python()
converters for a copyable type:
    python::x_class_builder<vects::ivect> ivect_class
(this_module, "ivect");

To export the converters for a type that is not copyable:
    python::xptr_class_builder<vects::ivect> ivect_class
(this_module, "ivect");

To import the converters in another extension module:
    python::import_class_builder<vects::dvect> dvect_class
("dvect", "dvect");

Examples that demonstrate and test the new features are:

  libs/python/example/noncopyable_export.cpp
  libs/python/example/noncopyable_import.cpp
  libs/python/example/dvect.cpp
  libs/python/example/ivect.cpp

(There are a number of additional new examples that are not related to
the new features.)

All examples compile and run with:
  Visual C++ 6.0, Service Pack 4
  Redhat 6.1, gcc-2.95.2
  Compaq C++ V6.2-024 for Digital UNIX V5.0 (Rev. 910) (Tru64)
  IRIX 6.5.10f, gcc-2.95.2 (except for comprehensive.cpp)

Makefiles for Linux and Compaq Tru64 are available in the build
directory:

  libs/python/build/Makefile.gcc
  libs/python/build/Makefile.tru64

Makefile.gcc also works for IRIX 6.5.10f/gcc-2.95.2, except that the
compilation of comprehensive.cpp results in an internal compiler
error.
The build files for Visual C++ are currently not in the CVS tree.

Currently all my changes to the actual BPL are concentrated in two
new files:

  boost/python/detail/import_extension_class.hpp
  libs/python/src/import_extension_class.cpp

At a later stage it would probably make sense to break up the files
and
put the code in more logical places. I am very interested in feedback,
especially regarding the "QUESTIONMARK"s in
import_extension_class.hpp.

Ralf


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk