[omniORB] Instanciating a sequence?

EntonH entonh at gmx.de
Mon Feb 18 02:45:17 GMT 2008


Hello,

I wrote an IDL in which I defined a struct which contains 2 values and a
sequence of structs:

interface MyIDL
{
   struct values
   {
      string value1;
      any value2;
   };

   typedef sequence<values> ValSeq;

   any init(in ValSeq vs);
}

Now I want to call a function, which has this sequence as an in-parameter:
any init(in ValSeq vs);

I want to wrote a test client in C++, in which I can create an instance of
the sequence so I can define its length und put some data in it:

MyIDL::ValSeq* myValSeq;
myValSeq = new MyIDL::ValSeq();
myValSeq->length(2);

CORBA::String_var tmpValue1 = CORBA::string_dup("Age");
(*myValSeq )[0].key = tmpValue1;
CORBA::Any tmpValue2;
tmpValue2 <<= "21";
(*myValSeq )[0].value = tmpValue2;

CORBA::String_var tmpValue1_2 = CORBA::string_dup("Age");
(*myValSeq )[1].key = tmpValue1_2;
CORBA::Any tmpValue2_2;
tmpValue2_2 <<= "25";
(*myValSeq )[1].value = tmpValue2_2;

Is this right?

But how do I realize this in Python so that I can fill my sequence with
structs to pass it to C++?

Greetings


-- 
View this message in context: http://www.nabble.com/Instanciating-a-sequence--tp15542521p15542521.html
Sent from the OmniORB - User mailing list archive at Nabble.com.




More information about the omniORB-list mailing list