Re: [C++-sig] How to wrap reference to abstract base class to get C++ polymorphism

2010-05-25 Thread Kun Hong
On 20/05/2010, at 11:03 PM, Kun Hong wrote: Hi, I have a maybe entry-level question. But it really troubled me for a while. I need to wrap a C++ library which has some factory method to return references to some abstract base classes. So the implementation is hidden. If I want a python equival

Re: [C++-sig] How to wrap reference to abstract base class to get C++ polymorphism

2010-05-24 Thread Nicolas Colombe
2010/5/20 Kun Hong > > > class B > { > public: >virtual const char *getName() const = 0; > }; > > BOOST_PYTHON_MODULE(Test) > { > >class_ >("B", no_init) >.def("getName", pure_virtual(&B::getName)) >; > >def("getB", &getB, > return_value

[C++-sig] How to wrap reference to abstract base class to get C++ polymorphism

2010-05-20 Thread Kun Hong
Hi, I have a maybe entry-level question. But it really troubled me for a while. I need to wrap a C++ library which has some factory method to return references to some abstract base classes. So the implementation is hidden. If I want a python equivalent to the abstract base class reference