summaryrefslogtreecommitdiff
path: root/Examples/python/import_template/foo.h
blob: 3df13d20db96cf386818b6df365ceb237b0161f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "base.h"

template<class T> class Foo : public Base<T> {
 public:
  Foo() { }
  ~Foo() { }
  virtual void A() { 
    printf("I'm Foo::A\n");
  }
  void B() {
    printf("I'm Foo::B\n");
  }
  virtual Base<T> *toBase() {
    return static_cast<Base<T> *>(this);
  }
  static Foo<T> *fromBase(Base<T> *b) {
    return dynamic_cast<Foo<T> *>(b);
  }
};