CMake/Tests/SwigTest/example.h

38 lines
590 B
C
Raw Normal View History

2004-04-30 20:17:06 +04:00
/* File : example.h */
class Shape
{
2004-04-30 20:17:06 +04:00
public:
Shape() { nshapes++; }
virtual ~Shape() { nshapes--; };
double x, y;
void move(double dx, double dy);
2004-04-30 20:17:06 +04:00
virtual double area(void) = 0;
virtual double perimeter(void) = 0;
static int nshapes;
2004-04-30 20:17:06 +04:00
};
class Circle : public Shape
{
2004-04-30 20:17:06 +04:00
private:
double radius;
2004-04-30 20:17:06 +04:00
public:
Circle(double r)
: radius(r){};
2004-04-30 20:17:06 +04:00
virtual double area(void);
virtual double perimeter(void);
};
class Square : public Shape
{
2004-04-30 20:17:06 +04:00
private:
double width;
2004-04-30 20:17:06 +04:00
public:
Square(double w)
: width(w){};
2004-04-30 20:17:06 +04:00
virtual double area(void);
virtual double perimeter(void);
};