Ticket #189 (closed enhancement: fixed)

Opened 2 months ago

Last modified 5 weeks ago

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:1 follow-up: ↓ 2 Changed 2 months ago by kyle

Agree to move forward with this change as discussed in the M&T SIG meeting 05/03/2024

Last edited 2 months ago by kyle (previous) (diff)

comment:2 in reply to: ↑ 1 Changed 2 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

comment:3 Changed 8 weeks ago by jasper

  • Status changed from new to closed
  • Resolution set to fixed

In [947168275740c0011f358be7881a303e7d8aa3fe]:

include merge fix #170 and fix #189

comment:4 Changed 7 weeks ago by jasper

  • Version changed from 1.2.0.14 to 1.2.1.0

comment:5 Changed 5 weeks ago by jasper

In [361faafb54198e8ccc580c149f22e6f84f40fc8c]:

additional fix #189 for test IDL

Note: See TracTickets for help on using tickets.