Previous Table of Contents Next


18.2.3 Mapping for Enumerators


   CORBA has enumerators that are not explicitly tagged with values. Microsoft IDL and ODL support enumerators that are explicitly tagged with values. The constraint is that any language mapping that permits two enumerators to be compared or defines successor or predecessor functions on enumerators must conform to the ordering of the enumerators as specified in the OMG IDL.

   // OMG IDLinterface MyInft {enum A_or_B_or_C {A, B, C};};

   CORBA enumerators are mapped to COM enumerations directly according to CORBA C language binding. The Microsoft IDL keyword v1_enum is required in order for an enumeration to be transmitted as 32-bit values. Microsoft recommends that this keyword be used on 32-bit platforms, since it increases the efficiency of marshalling and unmarshalling data when such an enumerator is embedded in a structure or union.

   // Microsoft IDL and ODLuuid(...),interface IMyIntf {

   typedef [v1_enum]

   enum tagA or B or C {MyIntf A = O,MyInft B,MyIntf C }

   MyIntf A or B or C;};

   A maximum of 232 identifiers may be specified in an enumeration in CORBA. Enumerators in Microsoft IDL and ODL will only support 216 identifiers, and therefore, truncation may result.