From: "Hal E. Fulton" Date: 2002-08-04T08:49:02+09:00 Subject: Re: embed or swig? ----- Original Message ----- From: "Massimiliano Mirra" To: "ruby-talk ML" Sent: Saturday, August 03, 2002 6:15 PM Subject: Re: embed or swig? > On Sun, Aug 04, 2002 at 07:56:21AM +0900, Phil Tomson wrote: > > We started off wanting to do unit testing of our C++ classes so I tried > > out Swig1.3.13 to wrap our classes. Let's say you have three classes, > > we'll call them Line, Polygon and Point and let's say you want to have > > them live in a namespace called Geo. You would define an interface file > > as an input to swig that would looks something like: > > > > %module Geo > > %{ > > #include "Line.h"; > > #include "Polygon.h"; > > #include "Point.h"; > > %} > > %include "Line.h"; > > %include "Polygon.h"; > > %include "Point.h"; > > > > //end of Geo.i (probably not completely right, I'm doing from > > memory) > > Wait a minute. Do you really mean that, after you've written your C++ > classes, you just feed nine lines to Swig and after some crunching you > have them available in Ruby? Or are you just simplifying? Well, from what I see on the SWIG site, it appears he's not oversimplifying. Potentially very exciting, eh? Hal