PageRenderTime 11ms CodeModel.GetById 1ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/ruby/import_template/spam.h

#
C++ Header | 24 lines | 21 code | 3 blank | 0 comment | 0 complexity | 7839ded9222a44f0f039bcc150b73052 MD5 | raw file
 1#include "bar.h"
 2
 3template<class T> class Spam : public Bar<T> {
 4 public:
 5  Spam() { }
 6  ~Spam() { }
 7  virtual const char * A() const { 
 8    return "Spam::A";
 9  }
10  const char * B() const {
11    return "Spam::B";
12  }
13  virtual Base<T> *toBase() {
14    return static_cast<Base<T> *>(this);
15  }
16  virtual Bar<T> *toBar() {
17    return static_cast<Bar<T> *>(this);
18  }
19  static Spam<T> *fromBase(Base<T> *b) {
20    return dynamic_cast<Spam<T> *>(b);
21  }
22};
23
24