[C++-sig] Fw: Problems using wrapper.hpp to override virtual functions

Hans Meine hans_meine at gmx.net
Wed Jan 23 20:52:18 CET 2008


On Mittwoch 23 Januar 2008, David Abrahams wrote:
> > I looked at the embedding.cpp example in libs/python/test which
> > allows for python to be executed in c++ code.  The problem is that I
> > need to have the c++ code call a function that is in a already running
> > python script.
>
> Why is that a problem?  You can just import the module and call the
> function, right?
>
> > Basically there are callbacks occurring in the c++
> > code.  I need to notify a running python client of these callbacks.

You can also export a C++ function that takes a bp::object parameter and pass 
a python function to C++ code (remember: functions are 1st class citizens in 
[boost::]python), if you don't have a module that you can easily import.

Ciao, /  /                                                    .o.
     /--/                                                     ..o
    /  / ANS                                                  ooo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20080123/87c724e4/attachment.pgp>


More information about the Cplusplus-sig mailing list