[omniORB] basic question about sequences
debutant
michel.dupront at hotmail.fr
Tue Aug 5 13:57:17 BST 2008
Thank you Michael, thank you Clarke !
I tried first:
seq_type* Foo_impl::bar(const seq_type& seq_in)
{
std::auto_ptr<seq_type> ret(new seq_type);
ret->length(seq_in.length());
for (unsigned int i=0; i<seq_in.length(); ++i)
{
(*ret)[i] = seq_in[i]*3;
}
return ret.release();
}
and it works well.
then I tried:
void Foo_impl::bar(const seq_type& seq_in, seq_type_out seq_out)
{
seq_out->length(seq_in.length());
for (unsigned int i=0; i<seq_in.length(); ++i)
{
seq_out[i] = seq_in[i]*2;
}
}
Line (3) gives me a problem (segmentation fault) (and (6) too).
I looked at the .hh file generated by the idl compilation and saw:
class seq_type_out {
...
inline seq_type* operator->() { return _data; }
...
}
I tried:
(seq_out.operator->())->length(seq_in.length());
and got the same problem.
It seems that there is something wrong with the class seq_type_out ...
Thanks a lot for your help. I am still full of hope !
Sincerely,
Michel
--
View this message in context: http://www.nabble.com/basic-question-about-sequences-tp18831089p18838737.html
Sent from the OmniORB - User mailing list archive at Nabble.com.
More information about the omniORB-list
mailing list