PageRenderTime 18ms CodeModel.GetById 9ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/trunk/Examples/perl5/import/foo.h

#
C++ Header | 21 lines | 18 code | 3 blank | 0 comment | 0 complexity | c833470c83fa6cb8df67846b589f2d43 MD5 | raw file
 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