Hi, I have to wrap a C++ API for Python. There are a couplt of difficulties: - The C++ classes have private constructors. - pointers to class instances are parameters for functions - callbacks that are initiated by the C++ side, but call functions implemented on the Python side. How do I do that? Any hint is appreciated.
Example: class X { public: X(); virtual ~X(); virtual callback(A* a) = 0; }; class Y::X { Y(); ~Y(); callback(A* a); } class M { public: M(); virtual ~M() protected: M(const M& m); M & operator=(const M& m); } class N::M { public: N() virtual ~N() private N(const N& n); N& operator=(const N& n); } class A: { public: A(); protected: A(const A& a); A& operator=(const A& a) } class B::A { public: B(); void create(Y* y, M* m); private: B(const B& b); B& operator=(const B& b); }; ===================================================== Python: class Y: __init__(): pass def callback(a): print "callback implemented in python" y=Y() n=N() b=B() b.create(y, n) The callback function y.callback(A* a) will be called by the C++ API when an event occurs. Kind Regards Manuela Kaelberer ---------------------------------------------- Manuela Kälberer IT FM Consulting (1432 H) Landesbank Baden-Württemberg Am Hauptbahnhof 2 D-70173 Stuttgart Phone +49 711 127-43753 Fax +49 711 127-437 59 manuela.kaelbe...@lbbw.de www.LBBW.de Landesbank Baden-Wuerttemberg Anstalt des oeffentlichen Rechts Hauptsitze: Stuttgart, Karlsruhe, Mannheim, Mainz HRA 12704 Amtsgericht Stuttgart _______________________________________________ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig