/trunk/Examples/tcl/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
- #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);
- }
- };