PageRenderTime 44ms CodeModel.GetById 19ms RepoModel.GetById 0ms 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
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. #include "base.h"
  2. template<class T> class Foo : public Base<T> {
  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<T> *toBase() {
  13. return static_cast<Base<T> *>(this);
  14. }
  15. static Foo<T> *fromBase(Base<T> *b) {
  16. return dynamic_cast<Foo<T> *>(b);
  17. }
  18. };