Hello guys, I am wrapping a C++ library and after changing from define
singleton method "new" to alloc function and initialize, I ran into this
problem, imagine the classes are like those:
class MyOtherClass
{
public:
MyOtherClass(int a, int b);
private:
int a;
int b;
}
class MyClass
{
public:
MyClass(int a, int b);
MyOtherClass myFunc(int c);
private:
int a;
int b;
};
1.- in alloc function, I have to create a MyClass object and wrap it with
Data_Wrap_Struct, but I cant create an object at that time, because I have no
constructor parameter until initialize (and I dont have a default constructor
either). How do I solve this?
2.- If class MyClass func returns a MyOther class object, whats the best way
to wrap this?, I have even a function that returns a collection of
MyOtherClass objects, so I think I have to iterate trough it, and create a
ruby wrapped object not from scratch but wrapping the current object in the
collection, and then add all the ruby objects to a Ruby array, in this case,
whats the best way to wrap it?
Thanks for the help guys!
Duncan