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

« back to all changes in this revision

Viewing changes to Examples/python/shadow/example.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2008-11-10 16:29:56 UTC
  • mfrom: (1.2.8 upstream) (2.1.3 lenny)
  • Revision ID: james.westby@ubuntu.com-20081110162956-xue6itkuqhbza87s
Tags: 1.3.36-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Drop pike and libchicken-dev from the build-depends 
    (both are universe)
  - Use python2.5 instead of python2.4.
  - use php5
  - Clean Runtime/ as well.
  - debian/Rules (clean): Remove Lib/ocaml/swigp4.ml.
  - drop "--without-mzscheme", we don't have it in our build-depends

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* File : example.h */
2
 
 
3
 
class Shape {
4
 
public:
5
 
  Shape() {
6
 
    nshapes++;
7
 
  }
8
 
  virtual ~Shape() {
9
 
    nshapes--;
10
 
  };
11
 
  double  x, y;   
12
 
  void    move(double dx, double dy);
13
 
  virtual double area() = 0;
14
 
  virtual double perimeter() = 0;
15
 
  static  int nshapes;
16
 
};
17
 
 
18
 
class Circle : public Shape {
19
 
private:
20
 
  double radius;
21
 
public:
22
 
  Circle(double r) : radius(r) { };
23
 
  virtual double area();
24
 
  virtual double perimeter();
25
 
};
26
 
  
27
 
class Square : public Shape {
28
 
private:
29
 
  double width;
30
 
public:
31
 
  Square(double w) : width(w) { };
32
 
  virtual double area();
33
 
  virtual double perimeter();
34
 
};
35
 
 
36
 
 
37
 
 
38
 
 
39