summaryrefslogtreecommitdiff
path: root/Examples/ruby
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2007-08-09 23:47:13 +0000
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2007-08-09 23:47:13 +0000
commitf5bdd056f704e53a3cf8525dd8becc5926db45a5 (patch)
tree4582617598db83ab8daa827c3b7b5da42f734d77 /Examples/ruby
parent665917ebae5d12d9d806b9ebe10e33872ee1c93c (diff)
downloadswig-f5bdd056f704e53a3cf8525dd8becc5926db45a5.tar.gz
Remove obscure mpointer example and replace with member_pointer.i testcase and runtime examples
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9887 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Examples/ruby')
-rw-r--r--Examples/ruby/check.list1
-rw-r--r--Examples/ruby/mpointer/Makefile20
-rw-r--r--Examples/ruby/mpointer/example.cxx48
-rw-r--r--Examples/ruby/mpointer/example.h47
-rw-r--r--Examples/ruby/mpointer/example.i15
-rw-r--r--Examples/ruby/mpointer/runme.rb48
6 files changed, 0 insertions, 179 deletions
diff --git a/Examples/ruby/check.list b/Examples/ruby/check.list
index 8d0a3f9de..131dcbb33 100644
--- a/Examples/ruby/check.list
+++ b/Examples/ruby/check.list
@@ -11,7 +11,6 @@ import
import_template
java
mark_function
-mpointer
multimap
operator
overloading
diff --git a/Examples/ruby/mpointer/Makefile b/Examples/ruby/mpointer/Makefile
deleted file mode 100644
index 2a8eb7b56..000000000
--- a/Examples/ruby/mpointer/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-TOP = ../..
-SWIG = $(TOP)/../preinst-swig
-CXXSRCS = example.cxx
-TARGET = example
-INTERFACE = example.i
-LIBS = -lm
-SWIGOPT =
-
-all::
- $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
- TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' ruby_cpp
-
-static::
- $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
- TARGET='myruby' INTERFACE='$(INTERFACE)' ruby_cpp_static
-
-clean::
- $(MAKE) -f $(TOP)/Makefile ruby_clean
-
-check: all
diff --git a/Examples/ruby/mpointer/example.cxx b/Examples/ruby/mpointer/example.cxx
deleted file mode 100644
index 80d95f618..000000000
--- a/Examples/ruby/mpointer/example.cxx
+++ /dev/null
@@ -1,48 +0,0 @@
-/* File : example.c */
-
-#include "example.h"
-#include <math.h>
-#ifndef M_PI
-# define M_PI 3.14159265358979323846
-#endif
-
-/* 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;
-}
-
-double do_op(Shape *s, double (Shape::*m)(void)) {
- return (s->*m)();
-}
-
-double (Shape::*areapt())(void) {
- return &Shape::area;
-}
-
-double (Shape::*perimeterpt())(void) {
- return &Shape::perimeter;
-}
-
-/* Member pointer variables */
-double (Shape::*areavar)(void) = &Shape::area;
-double (Shape::*perimetervar)(void) = &Shape::perimeter;
-
diff --git a/Examples/ruby/mpointer/example.h b/Examples/ruby/mpointer/example.h
deleted file mode 100644
index b90e14353..000000000
--- a/Examples/ruby/mpointer/example.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* File : example.h */
-
-class Shape {
-public:
- Shape() {
- nshapes++;
- }
- virtual ~Shape() {
- nshapes--;
- };
- double x, y;
- double *z;
-
- 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) { };
- virtual double area(void);
- virtual double perimeter(void);
-};
-
-class Square : public Shape {
-private:
- double width;
-public:
- Square(double w) : width(w) { };
- virtual double area(void);
- virtual double perimeter(void);
-};
-
-extern double do_op(Shape *s, double (Shape::*m)(void));
-
-/* Functions that return member pointers */
-
-extern double (Shape::*areapt())(void);
-extern double (Shape::*perimeterpt())(void);
-
-/* Global variables that are member pointers */
-extern double (Shape::*areavar)(void);
-extern double (Shape::*perimetervar)(void);
diff --git a/Examples/ruby/mpointer/example.i b/Examples/ruby/mpointer/example.i
deleted file mode 100644
index 253a224dc..000000000
--- a/Examples/ruby/mpointer/example.i
+++ /dev/null
@@ -1,15 +0,0 @@
-/* File : example.i */
-%module example
-
-%{
-#include "example.h"
-%}
-
-/* Let's just grab the original header file here */
-%include "example.h"
-
-/* Some constants */
-
-%constant double (Shape::*AREAPT)(void) = &Shape::area;
-%constant double (Shape::*PERIMPT)(void) = &Shape::perimeter;
-%constant double (Shape::*NULLPT)(void) = 0;
diff --git a/Examples/ruby/mpointer/runme.rb b/Examples/ruby/mpointer/runme.rb
deleted file mode 100644
index e11aa68cb..000000000
--- a/Examples/ruby/mpointer/runme.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-# Example using pointers to member functions
-
-require 'example'
-
-# Get the pointers
-
-area_pt = Example::areapt
-perim_pt = Example::perimeterpt
-
-puts "area_pt = #{area_pt}"
-puts "perim_pt = #{perim_pt}"
-
-# Create some objects
-
-c = Example::Circle.new(4)
-s = Example::Square.new(10)
-
-# Do some calculations
-
-puts "Circle area = #{Example::do_op(c, area_pt)}"
-puts "Circle perim = #{Example::do_op(c, perim_pt)}"
-puts "Square area = #{Example::do_op(s, area_pt)}"
-puts "Square perim = #{Example::do_op(s, perim_pt)}"
-
-puts "areavar = #{Example::areavar}"
-puts "perimetervar = #{Example::perimetervar}"
-
-# Try the variables
-puts "Circle area = #{Example::do_op(c, Example::areavar)}"
-puts "Circle perim = #{Example::do_op(c, Example::perimetervar)}"
-puts "Square area = #{Example::do_op(s, Example::areavar)}"
-puts "Square perim = #{Example::do_op(s, Example::perimetervar)}"
-
-# Modify one of the variables
-Example::areavar = perim_pt
-
-puts "Circle perimeter = #{Example::do_op(c, Example::areavar)}"
-
-# Try the constants
-
-puts "Example::AREAPT = #{Example::AREAPT}"
-puts "Example::PERIMPT= #{Example::PERIMPT}"
-puts "Example::NULLPT = #{Example::NULLPT}"
-
-puts "Circle area = #{Example::do_op(c, Example::AREAPT)}"
-puts "Circle perim = #{Example::do_op(c, Example::PERIMPT)}"
-puts "Square area = #{Example::do_op(s, Example::AREAPT)}"
-puts "Square perim = #{Example::do_op(s, Example::PERIMPT)}"