PageRenderTime 32ms CodeModel.GetById 25ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 1ms

/trunk/Examples/lua/import/spam.h

#
C++ Header | 24 lines | 21 code | 3 blank | 0 comment | 0 complexity | 0cb788fd2b6eae65a740818015c4bd51 MD5 | raw file
 1#include "bar.h"
 2
 3class Spam : public Bar {
 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 *toBase() {
14    return static_cast<Base *>(this);
15  }
16  virtual Bar *toBar() {
17    return static_cast<Bar *>(this);
18  }
19  static Spam *fromBase(Base *b) {
20    return dynamic_cast<Spam *>(b);
21  }
22};
23
24