[omniORB] function and sequence

DA SILVA Antonio adasilva at carax.com
Wed Jan 30 17:33:59 GMT 2008



Hi Ronald,

You can use also for the strings :
temp[0] = ( const char * )"klaus at uni.de";

Evgni, what about reference counting
with the "_retn( )"?

Antonio.


Ronald Andrae a écrit :
> Hello,
>
> thanks, you have fixed my problem. :-)
>
> evgeni.rojkov at durr.com schrieb:
>> Here are 2 improvement suggestions.
>> Regards, Evgeni
>>
>> // 1.
>> // temp[0] = "klaus at uni.de";   
>> temp[0] = CORBA::string_dup("klaus at uni.de");
>>
>> // 2.
>> //return temp;
>> return temp._retn();
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: omniorb-list-bounces at omniorb-support.com
>> [mailto:omniorb-list-bounces at omniorb-support.com] Im Auftrag von
>> Ronald Andrae
>> Gesendet: Mittwoch, 30. Januar 2008 15:16
>> An: omniorb-list at omniorb-support.com
>> Betreff: [omniORB] function and sequence
>>
>>
>> Hello,
>>
>> I have function, which returns a variable array (sequence).
>>
>> My IDL:
>>
>> typedef sequence<string> Feld;
>>
>> interface Student{
>>     Feld getEmails();
>> };
>>
>> My implementation:
>>
>> class Student_impl :  public POA_Student
>> {
>> public:
>>
>>     Feld * getEmails() {
>>         Feld_var temp = new Feld;
>>         temp->length(3);
>>         temp[0] = "klaus at uni.de";
>>         temp[1] = "gustav at uni.de";
>>         temp[2] = "dieter at uni.de";
>>         return temp;
>>     }
>> };
>>
>> There is a problem with the types Feld and Feld_var. Have anyone an
>> idea, how i can fix this problem, so that I can use the array at the
>> client side?
>>
>> Thanks
>>
>> _______________________________________________
>> omniORB-list mailing list
>> omniORB-list at omniorb-support.com
>> http://www.omniorb-support.com/mailman/listinfo/omniorb-list
>>
>>   
>
> _______________________________________________
> omniORB-list mailing list
> omniORB-list at omniorb-support.com
> http://www.omniorb-support.com/mailman/listinfo/omniorb-list
>




More information about the omniORB-list mailing list