IDL 4.3 RTF Avatar
  1. OMG Issue

IDL43 — inheritance of unions and enumerations

  • Key: IDL43-24
  • Status: open  
  • Source: Real-Time Innovations ( Dr. Gerardo Pardo-Castellote, Ph.D.)
  • Summary:

    IDL 4.2 syntax supports inheritance of only interfaces, valuetypes, and structures.

    There are multiple scenarios where it would be useful to inherit other types, specifically Unions and Enumerations.

    (1) Inheritance of unions

    This would be very useful in some specs where unions are automatically generated. For example unions are created interface definitions in DDS-RPC and derived interfaces would like to use unions that "inherit" the unions in the base interfaces.

    This would be useful when a "derived" union wants to add some more cases to the base union.

    The derived union would have to use the same discriminator type. All it can do is add new discriminator cases that do not conflict with the non-default discriminator in the base union.

    It can add a default case if not present in the base union.

    Proposed syntax would be:

    union DerivedUnion : BaseUnion {
        case 1 :
           Case1Type case1meber;
    ...
    };
    

    (2) Inheritance of enumerations

    This is useful to add literals to an existing enumeration without touching the original definition.

    The literals on the derived union would be constrained to not conflict the literals in the base class.

    Proposed syntax would be:

    enum DerivedEnum : BaseEnum {
        AdditionalLiteral1,
        ...
    };
    
  • Reported: IDL 4.2 — Tue, 25 Sep 2018 19:31 GMT
  • Updated: Tue, 8 Aug 2023 06:45 GMT