[C++-sig] boost.python question

Stefan Seefeld seefeld at sympatico.ca
Thu Mar 1 17:49:33 CET 2007


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...



More information about the Cplusplus-sig mailing list