/tags/rel-1-3-26/SWIG/Examples/perl5/import/foo.h
C++ Header | 21 lines | 18 code | 3 blank | 0 comment | 0 complexity | c833470c83fa6cb8df67846b589f2d43 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
1#include "base.h" 2 3class Foo : public Base { 4 public: 5 Foo() { } 6 ~Foo() { } 7 virtual void A() { 8 printf("I'm Foo::A\n"); 9 } 10 void B() { 11 printf("I'm Foo::B\n"); 12 } 13 virtual Base *toBase() { 14 return static_cast<Base *>(this); 15 } 16 static Foo *fromBase(Base *b) { 17 return dynamic_cast<Foo *>(b); 18 } 19}; 20 21