[C++-sig] Re: Exposing C++ objects to Python at runtime

David Abrahams dave at boost-consulting.com
Sat Nov 22 13:57:35 CET 2003


Jonathan Warrington <jonw at mindless.com> writes:

> I'm working on writing a generic interface for scripting, so far I
> have a simple javascript implementation, and a very simple python
> implementation.
>
> What I'm looking for, is there any way to register c++ classes /
> objects at runtime?  What I'd like to be able to do, is pass a string,
> and pointers (object, and function) into my interface which would then
> register them at runtime (dynamically)?  It looks quite possible for
> just straight functions, but was wondering if anyone had done
> something similar, or had any suggestions on how to do it?

Boost.Python already does that.  Your module initialization function
executes at runtime.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com





More information about the Cplusplus-sig mailing list