Hello

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:


class_A_Base <A, boost::noncopyable>("A_Base", no_init)  //this line can be 
modified

    .def("f", &B::f);
class_B <B, boost::noncopyable>("B", init< >())  //this line can be modified
    .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.
_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to