Ticket #189 (closed enhancement: fixed)
Consistent IDL type representation
Reported by: | jasper | Owned by: | jasper |
---|---|---|---|
Priority: | minor | Milestone: | Maintenance of Phase II |
Component: | COBIA IDL | Version: | 1.2.1.0 |
Keywords: | Cc: |
Description
COBIA IDL defines interfaces such that the name is in front of the content. Example:
[ uuid(b135a443-2ed8-45ef-bb2d-e68d2e631c31) ] interface ICapeCollection<CollectionItem> { [long_name(ItemByIndex)] CAPERESULT Item([in] CapeInteger index,[out, retval] CollectionItem item); //note: 0-based index [long_name(ItemByName)] CAPERESULT Item([in] CapeString name,[out, retval] CollectionItem item); [property_get] CAPERESULT Count([out, retval] CapeInteger itemCount); };
Enumerations however are defined with the name after the definition. Example:
[ uuid(7d33b558-3371-4ed6-a88b-735a5604ce70) ] enum { CAPE_ANY_STREAMS = 0, CAPE_MATERIAL_STREAM = 1, CAPE_ENERGY_STREAM = 2, CAPE_INFORMATION_STREAM = 3 } CapeStreamType;
The last top level element, CatID, does not have a definition. Example:
[ uuid(37e03033-63b9-4f55-b5c4-807bede03deb) ] category Component_1_2;
The enum syntax was more or less taken from COM. The equivalent COM definition, removing the official type and just going with the typedef'ed name:
[ uuid(7D33B558-3371-4ED6-A88B-735A5604CE70) ] typedef enum eCapeStreamType { CAPE_ANY_STREAMS = 0, CAPE_MATERIAL_STREAM = 1, CAPE_ENERGY_STREAM = 2, CAPE_INFORMATION_STREAM = 3 } CapeStreamType;
I feel this is a design mistake, and we are not too late to fix it yet. I think we should put the enum name before its definition, like so:
[ uuid(7d33b558-3371-4ed6-a88b-735a5604ce70) ] enum CapeStreamType { CAPE_ANY_STREAMS = 0, CAPE_MATERIAL_STREAM = 1, CAPE_ENERGY_STREAM = 2, CAPE_INFORMATION_STREAM = 3 };
and break previous IDL and no longer support the previous notation.
Change History
comment:2 in reply to: ↑ 1 Changed 9 months ago by kyle
Replying to kyle:
Agree to move forward with this change as discussed in the M&T SIG meeting 05 March 2024
Agree to move forward with this change as discussed in the M&T SIG meeting 05/03/2024