git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4141 626c5289-ae23-0410-ae9c-e8d60b6d4f22
21 lines
325 B
C++
21 lines
325 B
C++
#include "base.h"
|
|
|
|
class Foo : public Base {
|
|
public:
|
|
Foo() { }
|
|
~Foo() { }
|
|
virtual void A() {
|
|
printf("I'm Foo::A\n");
|
|
}
|
|
void B() {
|
|
printf("I'm Foo::B\n");
|
|
}
|
|
virtual Base *toBase() {
|
|
return static_cast<Base *>(this);
|
|
}
|
|
static Foo *fromBase(Base *b) {
|
|
return dynamic_cast<Foo *>(b);
|
|
}
|
|
};
|
|
|
|
|