How do I access derived class in python from abstract class(interface class) without exposing derived class, by only exposing abstract class. I do not want to expose derived class for python. Is there any way that I can access derived class through abstract class? The example code is:
Base.h
class Base
{
public:
virtual void Set(const std::vector<std::string>& AllParameters) = 0;
};
struct BaseWrap : Base, wrapper<Base>
{
void Set(const std::vector<std::string>& AllParameters)
{
this->get_override("Set")(AllParameters);
}
}
Base.cpp
BOOST_PYTHON_MODULE(Example)
{
class_<Basewrapper , boost::noncopyable> ("Base")
.def("Set",pure_virtual(&Base::Set))
;
}
Derived.h
class Derived : public Base
{
public:
void Set(const std::vector<std::string>& AllParameters);
int test(int a, int b);
};
Derived.cpp
void Derived::Set(const std::vector<std::string>& AllParameters)
{
//some code here
}
void Derived:: test(int a , int b)
{
return a+b;
}
DerivedorDerived::test()is intended to be used.