------art_14509_9665962.1198766784839
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Dec 27, 2007 7:36 AM, Robert Klemme <shortcutter / googlemail.com> wrote:

> 2007/12/27, Jason Roelofs <jameskilton / gmail.com>:
> > SWIG does not handle nested classes, a *serious* defect to what I'm
> trying
> > to do. I've looked into helping add this feature, but the amount of work
> > required makes it more feasible to build a better, Ruby-specific wrapper
> > system.
>
> I'm not too familiar with Boost.  So could you quickly summarize what
> is it that you expect to gain from creating a Boost Ruby integration?
>
> Kind regards
>
> robert
>
>
> --
> use.inject do |as, often| as.you_can - without end
>
>
Boost.Python and luabind are libraries built to make it extremely easy to
build interfaces into the target language from C++. It's not really about
integration with Boost, Boost just provides some very, very useful
constructs and a powerful meta-programming subsystem that makes this library
feasible in such a strict language. Here's what you're able to do:

Wrap this:

class A {
  public:
    A();
    A(int, int);

    void doSomething();
    int getSomethingBack();
};

Like this:

class_<A>("A")
   .def(initialize<int, int>())
   .def("do_something", &A::doSomething)
   .def("get_something_back", &A::getSomethingBack);

and in Ruby

a1  .new
a  .new(1,2)

a.do_something
a.get_something_back


For those of you pushing SWIG, trust me, I've spent many, many hours trying
different ways to make nested classes work in a way that won't require me to
re-write a full quarter of the headers that I'm trying to wrap (Ogre
rendering engine, for the record). Nested classes are *not* supported in
SWIG, there are hacks to make it look so, hacks that do not work all of the
time.

Jason

------art_14509_9665962.1198766784839--