AW: [omniORB] function and sequence

evgeni.rojkov at durr.com evgeni.rojkov at durr.com
Wed Jan 30 16:11:01 GMT 2008


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



More information about the omniORB-list mailing list