PageRenderTime 45ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Examples/python/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. class Foo : public Base {
  3. public:
  4. Foo() { }
  5. ~Foo() { }
  6. virtual void A() {
  7. printf("I'm Foo::A\n");
  8. }
  9. void B() {
  10. printf("I'm Foo::B\n");
  11. }
  12. virtual Base *toBase() {
  13. return static_cast<Base *>(this);
  14. }
  15. static Foo *fromBase(Base *b) {
  16. return dynamic_cast<Foo *>(b);
  17. }
  18. };