Ruby - C++ extension

Ask a Question related to Ruby, Design and Development.

  1. #1

    Default Ruby - C++ extension

    Hello!

    I am trying to create a new Ruby extension, which eventually will
    give to Ruby the functionality of a C++ project.

    So far, the extension is going fine. However I have two issues:

    (1) C++ Type Casting
    (2) Multiple Inheritance

    Is there a generic approach to solve the above?

    As far as C++ Type Casting is concerned I am thinking of creating
    to_xxx methods. I.e.

    foo = (Foo *) Bar->dump();

    will be in Ruby:

    foo = Bar.dump.as_Foo

    As far as Multiple Inheritence is concerned, I think the only way
    to go through is to define modules and include them in other modules.
    Howver the C++ project I'm trying to create Ruby Bindings for, has a very
    complex inheritence tree. Is there any other workaround?

    Regards,
    --
    University of Athens I bet the human brain
    Physics Department is a kludge --Marvin Minsky



    Elias Athanasopoulos Guest

  2. Similar Questions and Discussions

    1. Any Extension for Ruby On Rails on DW
      Hello, I am planning to quit PHP and start developing in Ruby on Rails. Their MVC model is really great and plus MS has also appreciated this...
    2. Ruby Extension/DLL Help
      Hi, Recently i started writing a Ruby extension. This Extension is providing access to a dll-library. It has been written in c. Compiling works...
    3. Two problems creating a C++ extension to Ruby
      Hello, I'm having some trouble with my first C++ extension for Ruby. The extension is a wrapper for the id3lib library providing my own interface...
    4. Exception handling in ruby extension
      Quick question, How do you handle exceptions in a ruby extension? I see rb_rescue, but it don't see how I get at the exception object in func2. ...
    5. warning in ruby extension eats memory
      I've written extension in C for ruby and created test case for it. When I've run it ruby eat all memory. I've simplified code as I can and here is...
  3. #2

    Default Re: Ruby - C++ extension

    On Sunday, 23 November 2003 at 17:44:39 +0900, Elias Athanasopoulos wrote:
    > Hello!
    >
    > I am trying to create a new Ruby extension, which eventually will
    > give to Ruby the functionality of a C++ project.
    >
    > So far, the extension is going fine. However I have two issues:
    >
    > (1) C++ Type Casting
    > (2) Multiple Inheritance
    I haven't checked the specifics, but have you read Lyle's talk
    from the 2002 Rubyconf?

    [url]http://www.zenspider.com/Languages/Ruby/RubyConf2002/[/url]

    --
    Jim Freeze
    ----------
    Klein bottle for sale ... inquire within.


    Jim Freeze Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139