~ubuntu-branches/ubuntu/warty/swig1.3/warty

« back to all changes in this revision

Viewing changes to Examples/python/import_template/bar.h

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Landschoff
  • Date: 2002-03-29 01:56:07 UTC
  • Revision ID: james.westby@ubuntu.com-20020329015607-c0wt03xu8oy9ioj7
Tags: upstream-1.3.11
ImportĀ upstreamĀ versionĀ 1.3.11

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "base.h"
 
2
 
 
3
template<class T> class Bar : public Base<T> {
 
4
 public:
 
5
  Bar() { }
 
6
  ~Bar() { }
 
7
  virtual void A() { 
 
8
    printf("I'm Bar::A\n");
 
9
  }
 
10
  void B() {
 
11
    printf("I'm Bar::B\n");
 
12
  }
 
13
  virtual Base<T> *toBase() {
 
14
    return static_cast<Base<T> *>(this);
 
15
  }
 
16
  static Bar<T> *fromBase(Base<T> *b) {
 
17
    return dynamic_cast<Bar<T> *>(b);
 
18
  }
 
19
 
 
20
};
 
21
 
 
22