DDS-XTypes 1.4 RTF Avatar
  1. OMG Issue

DDSXTY14 — Update IDL definition of union TypeIdentifier in Annex B to account for primitive types

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

    The union TypeIdentifier definitoon in Annex B contain several cases commended out. This is done because (per the comment in the IDL) union cases all have to have an associated member/value

    // All primitive types fall here.
    // Commented-out because Unions cannot have cases with no member.
    case TK_NONE:
    case TK_BOOLEAN:
    case TK_BYTE_TYPE:
    case TK_INT8_TYPE:
    case TK_INT16_TYPE:

    Since the union discriminator is an octet, it is possible to set it to the values shown in the comment (e.g. TK_INT8_TYPE) in this situation since the case member is not shown the discriminator will be set but no branch would be selected so there is no associated value.
    In other words, we can get the desired behavior of having the discriminator set but no value selected (so nothing beyond the discriminator is serialized), but we cannot express the expectation of all those cases in the IDL...

    This could be corrected in two ways:
    (1) We could use a enumerated value with @bit_bound(8) as the type of the discriminator instead of the octet. The list of literals would make it obvious what the expected values for the discriminator
    (2) We could keep the union discriminated by an octet and uncomment all the cases for the primitive types. Then we would need to add a "dummy" member so the case has an associated value, but we could mark it @non_serialized so it has no impact on the wire representation.

    It would seem that (1) is cleaner but (2) is less disruptive...

  • Reported: DDS-XTypes 1.3b1 — Sat, 12 Aug 2023 02:20 GMT
  • Updated: Wed, 16 Aug 2023 15:56 GMT