diff --git a/SWIG/Examples/perl5/shadow/.cvsignore b/SWIG/Examples/perl5/shadow/.cvsignore deleted file mode 100644 index 618145e24..000000000 --- a/SWIG/Examples/perl5/shadow/.cvsignore +++ /dev/null @@ -1,10 +0,0 @@ -example.pm -*_wrap.c -*_wrap.cxx -example.dll -example.dsw -example.ncb -example.opt -example.plg -Release -Debug diff --git a/SWIG/Examples/perl5/shadow/Makefile b/SWIG/Examples/perl5/shadow/Makefile deleted file mode 100644 index 2f01aed66..000000000 --- a/SWIG/Examples/perl5/shadow/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -TOP = ../.. -SWIG = $(TOP)/../swig -CXXSRCS = example.cxx -TARGET = example -INTERFACE = example.i -LIBS = -lm -SWIGOPT = - -all:: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ - SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' perl5_cpp - -static:: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ - SWIGOPT='$(SWIGOPT)' TARGET='myperl' INTERFACE='$(INTERFACE)' perl5_cpp_static - -clean:: - $(MAKE) -f $(TOP)/Makefile perl5_clean - -check: all diff --git a/SWIG/Examples/perl5/shadow/example.cxx b/SWIG/Examples/perl5/shadow/example.cxx deleted file mode 100644 index 1e8e203dd..000000000 --- a/SWIG/Examples/perl5/shadow/example.cxx +++ /dev/null @@ -1,28 +0,0 @@ -/* File : example.c */ - -#include "example.h" -#define M_PI 3.14159265358979323846 - -/* Move the shape to a new location */ -void Shape::move(double dx, double dy) { - x += dx; - y += dy; -} - -int Shape::nshapes = 0; - -double Circle::area(void) { - return M_PI*radius*radius; -} - -double Circle::perimeter(void) { - return 2*M_PI*radius; -} - -double Square::area(void) { - return width*width; -} - -double Square::perimeter(void) { - return 4*width; -} diff --git a/SWIG/Examples/perl5/shadow/example.h b/SWIG/Examples/perl5/shadow/example.h deleted file mode 100644 index 1f6f8b304..000000000 --- a/SWIG/Examples/perl5/shadow/example.h +++ /dev/null @@ -1,41 +0,0 @@ -/* File : example.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; -}; - -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); -}; - - - - - diff --git a/SWIG/Examples/perl5/shadow/example.i b/SWIG/Examples/perl5/shadow/example.i deleted file mode 100644 index 23ee8a822..000000000 --- a/SWIG/Examples/perl5/shadow/example.i +++ /dev/null @@ -1,11 +0,0 @@ -/* File : example.i */ -%module example - -%{ -#include "example.h" -%} - -/* Let's just grab the original header file here */ - -%include "example.h" - diff --git a/SWIG/Examples/perl5/shadow/index.html b/SWIG/Examples/perl5/shadow/index.html deleted file mode 100644 index ecfdb6d0f..000000000 --- a/SWIG/Examples/perl5/shadow/index.html +++ /dev/null @@ -1,233 +0,0 @@ - -
--This example illustrates the most primitive form of C++ class wrapping performed -by SWIG. In this case, C++ classes are simply transformed into a collection of -C-style functions that provide access to class members. - -
-
-/* File : example.h */
-
-class Shape {
-public:
- Shape() {
- nshapes++;
- }
- virtual ~Shape() {
- nshapes--;
- };
- double x, y;
- void move(double dx, double dy);
- virtual double area() = 0;
- virtual double perimeter() = 0;
- static int nshapes;
-};
-
-class Circle : public Shape {
-private:
- double radius;
-public:
- Circle(double r) : radius(r) { };
- virtual double area();
- virtual double perimeter();
-};
-
-class Square : public Shape {
-private:
- double width;
-public:
- Square(double w) : width(w) { };
- virtual double area();
- virtual double perimeter();
-};
-
-
-
-
-
-/* File : example.i */
-%module example
-
-%{
-#include "example.h"
-%}
-
-/* Let's just grab the original header file here */
-%include "example.h"
-
-
-
-Note: when creating a C++ extension, you must run SWIG with the -c++ option like this:
--- --% swig -c++ -python example.i --
-- --$c = example::new_Circle(10.0); --
-
-- -Note: when accessing member data, the name of the base class or the derived class can be -used in the function name as shown above. Of course, it would probably be more -proper to just use the base class version such as Shape_x_get() - --example::Circle_x_set($c,15); # Set member data -$x = example::Shape_x_get($c); # Get member data --
-
-- --print "The area is ", example::Shape_area($c); --
-
-- --example::Shape_area($c); # Works (c is a Shape) -example::Circle_area($c); # Works (c is a Circle) -example::Square_area($c); # Fails (c is definitely not a Square) --
-
-- --example::delete_Shape($c); # Deletes a shape --
-
-- --$n = $example::Shape_nshapes; # Get a static data member -$example::Shapes_nshapes = 13; # Set a static data member --
-
-
-
-- --void foo(int a); -%name(foo2) void foo(double a, double b); --
-
-
-%inline %{
- Vector *vector_add(Vector *a, Vector *b) {
- ... whatever ...
- }
-%}
-
-
-
--
-
-
-%{
-typedef vector IntVector;
-%}
-
-class IntVector {
-public:
- ... methods ...
-};
-
-
--