[omniORB] problem differentiating between Arrays and Sequences

Tim Black timblack0 at gmail.com
Wed Jul 29 21:39:37 BST 2009


The CORBA Core Spec has separate syntax for Arrays and Sequences. Sequences
are variable-length, and may optionally have a bound:

sequence<long> UnboundLongs;
sequence<long, 10> BoundLongs;

Arrays are fixed-length sequences, defined thusly:

long ExactlyTenLongs[10];

In omniIDL documentation, I can see that there is no mention of this
fixed-length Array type. However, I can see that there is a type kind for
arrays: idltype.tk_array. But when I visit an IDL array (e.g.
ExactlyTenLongs above) in my back end, the type comes out looking like a
bounded sequence, i.e. the type of the corresponding AST node is an instance
of class Sequence, it's self.__kind is tk_sequence, not tk_array, and bound
= 10. What gives? Does omniIDL not support the CORBA array construct?

Being able to differentiate between arrays and sequences is useful because
you can map IDL arrays to C-style arrays which use the stack, and map IDL
sequences to C++-style vectors, which will use the heap. I assume this is
the reason why CORBA spec differentiates between the two types.

Thoughts?

Thanks,
Tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20090729/898e52ec/attachment.htm


More information about the omniORB-list mailing list