[ANN] Rice 1.3.1 - Bug fixes and memory management tweaks

J

Jason Roelofs

[Note: parts of this message were removed to make it a legal post.]

Rice: Ruby Interface for C++ Extensions
========================================

What is Rice?

Rice is a C++ interface to Ruby's C API. It provides a type-safe and
exception-safe interface in order to make embedding Ruby and writing
Ruby extensions with C++ easier. It is similar to Boost.Python in many
ways, but also attempts to provide an object-oriented interface to all
of the Ruby C API.


What's New?

* Fixed local gem install (~/.gem)
* Fixed compilation error on no-argument static class methods that return
reference types
* Better implicit handling of const reference types

* Fixed potential memory leaks when dealing with Rice::Arg

* Changed mailing list away from Google Groups to http://librelist.com


Supported Platforms:

* Linux
* Mac OS X 10.5 and 10.6
* Windows with MinGW / MSYS


What Rice gives you:

* A simple C++-based syntax for wrapping and defining classes
* Automatic conversion of exceptions between C++ and Ruby
* Smart pointers for handling garbage collection
* Wrappers for most builtin types to simplify calling code

Documentation: http://rice.rubyforge.org

Project Page: http://github.com/jameskilton/rice

Mailing List: (e-mail address removed)
First email will be used as subscription and dropped.


How do you get Rice?

gem install rice

Note: Rice does require a C++ compiler. See the Documentation page for
more details.


How simple of a syntax?

wrapper.cpp

#include <rice/Class.hpp>
#include <rice/Constructor.hpp>

class MyWrapper {
public:
MyWrapper() { }

void doThis() { }
int doThat(int a, float b) { }
};

extern "C"
void Init_wrapper()
{
define_class<MyWrapper>("MyWrapper")
.define_constructor(Constructor<MyWrapper>())
.define_method("do_this", &MyWrapper::doThis)
.define_method("do_that", &MyWrapper::doThat);
}

extconf.rb

require 'mkmf-rice'
create_makefile("wrapper")

test.rb

require 'wrapper'
c = MyWrapper.new
c.do_this
c.do_that(1, 2.0)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top