Mailinglist Archive: zypp-devel (56 mails)
| < Previous | Next > |
Re: [zypp-devel] Re: [zypp-commit] r8131 - in /trunk/sat-solver/bindings: ruby/CMakeLists.txt ruby/ruby.i ruby/satsolver.rb ruby/tests/ ruby/tests/loading.rb ruby/tests/pool.rb ruby/tests/repo.rb satsolver.i
- From: Duncan Mac-Vicar Prett <dmacvicar@xxxxxxx>
- Date: Fri, 21 Dec 2007 11:22:46 +0100
- Message-id: <200712211122.46966.dmacvicar@xxxxxxx>
Huh ? I don't understand the part of wrapping in Ruby code.
Have a look at the current satsolver.i file and the examples in
ruby/tests. I think its pretty straightforward.
Adding C++ classes seems more complex to me. But I'm open to any
counterexamples ... :-P
C++ classes have been always there! since my first version.
%extend Pool {
Pool()
{ return pool_create(); }
~Pool()
{ pool_free($self); }
That adds methods to the C struct. So SWIG is not parsing a C struct anymore
but a C++ class. That is why the ruby pool class has member functions,
constructors etc, otherwise you would get a plain C struct in Ruby (unless we
wrap/extend them in pure ruby code).
Where I am wrong is that even if SWIG is parsing C++, the output extension can
be plain C I guess. I am not sure.
Duncan
--
To unsubscribe, e-mail: zypp-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-devel+help@xxxxxxxxxxxx
| < Previous | Next > |