PageRenderTime 45ms CodeModel.GetById 36ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/python/import_template/foo.h

#
C++ Header | 21 lines | 18 code | 3 blank | 0 comment | 0 complexity | 1157c8e7391d1802052ca9d9ae40e0af MD5 | raw file
 1#include "base.h"
 2
 3template<class T> class Foo : public Base<T> {
 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<T> *toBase() {
14    return static_cast<Base<T> *>(this);
15  }
16  static Foo<T> *fromBase(Base<T> *b) {
17    return dynamic_cast<Foo<T> *>(b);
18  }
19};
20
21