Previous Table of Contents Next


18.2.8 Mapping for Array Types


   OMG IDL arrays are fixed length multidimensional arrays. Both Microsoft IDL and ODL also support fixed length multidimensional arrays. Arrays defined in OMG IDL map bidirectionally to COM fixed length arrays. The type of the array elements is mapped according to the data type mapping rules.

   The mapping for an OMG IDL array of some type T is that of an array of the type U as defined in Microsoft IDL and ODL, where U is the result of mapping the OMG IDL T into Microsoft IDL or ODL.

   // OMG IDL for T const long N = ...; typedef ... T; typedef T ARRAY_OF_T[N];

    // Microsoft IDL or ODL for Tconst long N = ...;typedef ... U;typedef U ARRAY_OF_U[N];

   In Microsoft IDL and ODL, the name ARRAY_OF_U denotes the type of a “onedimensional nonconformant and nonvarying array of U.? The value N can be of any integral type, and const means (as in OMG IDL) that the value of N is fixed and known at IDL compilation time. The generalization to multidimensional arrays follows the obvious mapping of syntax.

   Note that if the ellipsis were octet in the OMG IDL, then the ellipsis would have to be byte in Microsoft IDL or ODL. That is why the types of the array elements have different names in the two texts.