new example
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@840 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
f15486f6c4
commit
52386c6406
5 changed files with 48 additions and 0 deletions
|
|
@ -9,9 +9,11 @@ public:
|
|||
nshapes--;
|
||||
};
|
||||
double x, y;
|
||||
char foo[256];
|
||||
void move(double dx, double dy);
|
||||
virtual double area() = 0;
|
||||
virtual double perimeter() = 0;
|
||||
char *name() { return "Shape"; }
|
||||
static int nshapes;
|
||||
};
|
||||
|
||||
|
|
@ -24,6 +26,13 @@ public:
|
|||
virtual double perimeter();
|
||||
};
|
||||
|
||||
class XCircle : public Circle {
|
||||
public:
|
||||
XCircle(double r) : Circle(r) { };
|
||||
virtual double area();
|
||||
char *name() { return "XCircle"; }
|
||||
};
|
||||
|
||||
class Square : public Shape {
|
||||
private:
|
||||
double width;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,9 @@
|
|||
%}
|
||||
|
||||
/* Let's just grab the original header file here */
|
||||
%typemap(memberin) char [ANY] {
|
||||
strncpy($target,$source,$dim0);
|
||||
}
|
||||
|
||||
%include "example.h"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue