Using an element of a class A in a constructor of a class B (reflection with boost::python)

Hello everyone, The situation is as follow. I have a C++ code that I haven't written and that I barely can modified. I am supposed to reflect this code in Python with boost. In the code, I have something looking like this: Class A_Base { A_Base(){}; ~A_Base(){}; Whatever virtual and pure virtual functions; } Class A_Derived{ A_Derived(Type1 arg1,...){whatever instructions;} ~A_Derived(){}; Whatever functions; } Class B { B(A_Base& aBase, double& x){}; ~B(){}; Whatever functions; } In the C++ main, at some point aDerived A_Derived is set, and then B(aDerived, x). I need to reflect that under python. Until now, I have been able, with a simple example, to reflect a function f, which is not a ctor, from a class B using A_Base& as argument type, but I can't figure out how to deal with it for a constructor. Based on: http://wiki.python.org/moin/boost.python/ExportingClasses I am declaring f under both its class B and A_Base as follow: .def("f", &B::f) But when I try this for a constructor as f, it refuse to compile. Anyone got a clue? Thank you very much in advance for any further help.
participants (1)
-
christophe jean-joseph