swig/Examples/php4/overloading/example.h
Kevin Ruland 522ab32693 Updated examples to function correctly with new php4 module. Added
some supplemental examples for cpointer, overloading and references using
proxies.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7391 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-08-24 16:32:41 +00:00

45 lines
814 B
C++

/* File : example.h */
#include <stdio.h>
class Shape {
public:
Shape() {
nshapes++;
}
virtual ~Shape() {
nshapes--;
};
double x, y;
void move(double dx, double dy);
virtual double area(void) = 0;
virtual double perimeter(void) = 0;
static int nshapes;
static int get_nshapes();
};
class Circle : public Shape {
private:
double radius;
public:
Circle(double r) : radius(r) { };
~Circle() { };
virtual double area(void);
virtual double perimeter(void);
};
class Square : public Shape {
private:
double width;
public:
Square(double w) : width(w) { };
~Square() { }
virtual double area(void);
virtual double perimeter(void);
};
char *overloaded( int i );
char *overloaded( double d );
char *overloaded( const Circle& );
char *overloaded( const Shape& );