PageRenderTime 55ms CodeModel.GetById 50ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/perl5/import/spam.h

#
C++ Header | 24 lines | 21 code | 3 blank | 0 comment | 0 complexity | a23cd0edf6a75f45b148646dc862f46d MD5 | raw file
 1#include "bar.h"
 2
 3class Spam : public Bar {
 4 public:
 5  Spam() { }
 6  ~Spam() { }
 7  virtual void A() { 
 8    printf("I'm Spam::A\n");
 9  }
10  void B() {
11    printf("I'm Spam::B\n");
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