Re: CORBA_sequence_CORBA_long
- From: Michael Meeks <michael ximian com>
- To: orbit-list gnome org
- Subject: Re: CORBA_sequence_CORBA_long
- Date: Sat, 7 Jul 2001 12:28:54 -0400 (EDT)
Hi Samuele,
On Fri, 6 Jul 2001, samuele Gallazzi wrote:
> in an IDL file I declared a sequence as:
> "typedef sequence <long> list;
> readonly attribute list ID;
>
> This is mapped in C with CORBA_sequenceCORBA_long type. I don't
> understand how this type is structured: can I access to it like I make
> with an array?
Yes, there are two elements:
_buffer, and _length that you need to maintain, eg.
{
CORBA_sequence_CORBA_long *b = CORBA_sequnce_CORBA_long__alloc ();
b->_buffer = CORBA_sequence_CORBA_long__allocbuf (20);
b->_length = 20;
for (i = 0; i < 20; i++)
b->_buffer [i] = my_long * i;
return b;
}
> In particular, in the skeleton-impl file where is the error if I try
> to use "servant->attr_ID[i]" to access to the data in the sequence? Or
> this sequence is mapped like a linked list? And if so which is its
> internal structure? Thank you again. Samue
A plain array, no magic.
HTH,
Michael.
--
mmeeks@gnu.org <><, Pseudo Engineer, itinerant idiot
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]