[omniORB] Is it possible to use vectors in IDL ?
Johnny Willemsen
jwillemsen at remedy.nl
Mon Dec 19 12:29:28 GMT 2011
Hi,
>> Hi I was justgoing over Vinoskis C++ and CORBA book and came across
>> the IDL and the following example:
>>
>> struct TimeOfDay {
>> short hour; // 0 - 23
>> short minute; // 0 - 59
>> short second; // 0 - 59
>> };
>>
>> interface Time {
>> TimeOfDay get_gmt();
>> };
>>
>> I was just curious can we use std::vector type in TimeOfDay ?
>> I am still going over the book . but it will be great to have your
>> opinions..
>
> You are using the best book I've found. The data types available are
> only those defined in the CORBA standard and afaik the current standard
> does not map anything into STL data types (not sure if that changes for
> the next version). There is an IDL data type "sequence" which might do
> what you want; it is an unbounded vector and has accessible attributes
> much like the STL type.
The IDL to C++ mapping as described in this books make the IDL sequence
to its own special container.
Work is currently being done to define a new IDL to C++11 language
mapping which maps the IDL sequence to a std::vector by default. For
more information regarding this new language mapping (which will be much
more userfriendly) see http://www.orbzone.org. There are some articles
and discussion forums concerning this new mapping.
Regards,
Johnny
More information about the omniORB-list
mailing list