Hi,

> [...]
>  // expose to python
> BOOST_PYTHON_MODULE(grids)
>  {
>     class_<A2Wrap, boost::shared_ptr<A2Wrap> , boost::noncopyable >("A2")
>    .def("ret",pure_virtual(&A2::ret));
>
>     class_<B2,boost::shared_ptr<B2>,bases<A2>>("B2");
>     def("f1",f1);
>  }
>
>
> I get the following result on execution :
>
> >import grids
> >>> a = grids.f1()
>
> Traceback (most recent call last):
>
> File "<stdin>", line 1, in <module>
> TypeError: No to_python (by-value) converter found for C++ type:
> boost::shared_ptr<A2>

What happens if you expose like this:

     class_<A2, boost::shared_ptr<A2Wrap> , boost::noncopyable >("A2")
            ^^
            |- original class here, not the callback-wrapper class

?

Holger


Landesbank Baden-Wuerttemberg
Anstalt des oeffentlichen Rechts
Hauptsitze: Stuttgart, Karlsruhe, Mannheim, Mainz
HRA 12704
Amtsgericht Stuttgart

_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
https://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to