Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: Gordon Rios
RE: Returning C++ Types From Rice Methods [ reply ]  
2008-05-22 02:03
That was poorly worded -- assume the C++ function is something like:

Rice::Array
Foo::Bar(int x) {
Rice::Array a;
// load a with MyStruct [ms1, ms2, ..., ms3]
return a;
}

Thanks

By: Gordon Rios
Returning C++ Types From Rice Methods [ reply ]  
2008-05-22 01:57
What's the best way to return an array of MyStruct where MyStruct is a user defined struct from a rice method.

For example, if I have stuct MyStruct and want to return an Rice::Array with them to ruby how do I define my to_ruby method? Can I use Rice::Struct? in

template<>
Object to_ruby(Mystruct const & t)
{
// build up a Rice::Struct
// return it
}