From: Martin Man Date: 2002-06-07T17:51:33+09:00 Subject: Re: subclassing SWIG generated c++ class --96YOpH+ONegL0A3E Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 07, 2002 at 05:34:22PM +0900, Christian Szegedy wrote: > Martin Man wrote: >=20 > > > >k =3D Myext::Foo.new > >puts k > >k1 =3D Myext::Bar.new > >puts k1 > > > > > >both .new statements create instance of Myext::Foo... >=20 > .... and this is completely correct and intended. The object in > the subclass contains data for all base classes. What's the > problem? well the problem is that you'd expect my program to output something like # # but it's outputting # # the problem was exactly what Pierre Brengard suggested, missing call to rb_obj_call_init inside of wrapped new Ruby method, I've now tried cvs version of SWIG which splits c++ constructors into two methods, - singleton method 'alloc'=20 - and instance method 'initialize' and now I can happily wrap c++ classes inside ruby... thanx, martin --=20 God: What are you doing now? Arthur: Averting our eyes, oh Lord. God: Well, don't. It's just like those miserable psalms, always so depress= ing. -- Monty Python and the Holy Grail --96YOpH+ONegL0A3E Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9AHPaYgJwJG4GAiMRAugIAJ9worLGnmEFzvG8eqj1NmjZ+OKctACgmbiE YkxUF1hOcBQfc5/VXwL3ts4= =0lTO -----END PGP SIGNATURE----- --96YOpH+ONegL0A3E--