[boost::python] problems wrapping a base class
HI,
I'm working on exposing what should be a factory to create derived objects using the standard pattern for such a factory. In short, I have something like the following:
Class Base {
// some private member variables
Public:
Virtual void Func1() =0;
Virtual void Func2();
};
Class Derv1 : public Base {
// override Func1()
// override Func2()
};
Class BaseWrapper : public Base, boost::python::wrapper<Base> {
Void Func1() {
Get_override("Func1")();
}
Void Func2() {
If(boost::python::override func = get_override("Func2"))
{
Func();
Return;
}
Base::Func2();
}
};
Base* Factory(int selector) {
// return derived classes base on selector
}
BOOST_PYTHON_MODULE(myMod) {
Class_
participants (1)
-
Andy Falanga (afalanga)