hi all, i've got a question regarding the following setup: i've got a c++ class foo, that's wrapped into a python class and a class bar, that stores a pointer to an instance of foo... class foo{}; class bar{ void set(foo * newf) { f = newf;} foo * get(void) { return f;} virtual void override_me_from_python() { } protected: foo * f; }; so ... i'm a bit puzzled, how to wrap the class bar, so that it can access bar::f when implementing the virtual function from python ... any hints / pointers to examples or documentation? thanks in advance ... tim -- tim@klingt.org ICQ: 96771783 http://tim.klingt.org I must say I find television very educational. The minute somebody turns it on, I go to the library and read a good book. Groucho Marx
Tim Blechmann wrote:
hi all,
i've got a question regarding the following setup:
i've got a c++ class foo, that's wrapped into a python class and a class bar, that stores a pointer to an instance of foo...
class foo{};
class bar{ void set(foo * newf) { f = newf;} foo * get(void) { return f;}
virtual void override_me_from_python() { }
protected: foo * f; };
so ... i'm a bit puzzled, how to wrap the class bar, so that it can access bar::f when implementing the virtual function from python ...
...by exporting the bar::get method such that you can call it from within python code ? HTH, Stefan -- ...ich hab' noch einen Koffer in Berlin...
On Thu, 2007-03-01 at 11:49 -0500, Stefan Seefeld wrote:
Tim Blechmann wrote:
hi all,
i've got a question regarding the following setup:
i've got a c++ class foo, that's wrapped into a python class and a class bar, that stores a pointer to an instance of foo...
class foo{};
class bar{ void set(foo * newf) { f = newf;} foo * get(void) { return f;}
virtual void override_me_from_python() { }
protected: foo * f; };
so ... i'm a bit puzzled, how to wrap the class bar, so that it can access bar::f when implementing the virtual function from python ...
...by exporting the bar::get method such that you can call it from within python code ?
ah, cool ... didn't think, that it's that easy .... thanks ... tim -- tim@klingt.org ICQ: 96771783 http://tim.klingt.org I must say I find television very educational. The minute somebody turns it on, I go to the library and read a good book. Groucho Marx
participants (2)
-
Stefan Seefeld -
Tim Blechmann