[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: c++ extension
From:       Caleb Tennis <caleb () aei-tech ! com>
Date:       2006-03-10 12:00:41
Message-ID: 0834BF5F-5B1B-4BE2-817B-59844405F592 () aei-tech ! com
[Download RAW message or body]

>
> How should I go about wrapping these c++ classes?

You need to wrap your class into a Ruby structure in order for this  
to work right.

See: Data_Wrap_Struct and Data_Make_Struct for details

I'm not sure the implications of using an auto_ptr in the mix...as  
I've never tried it.  But, if you use the above methods you don't  
need it since Ruby will handle the lifetime of your object for you  
(and provide a garbage collection hook for your destructor).


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic