IDL4-CPP 1.0b2 FTF Avatar
  1. OMG Issue

IDL4CPP — @value annotation does not fully specify its behavior

  • Key: IDL4CPP-9
  • Status: open  
  • Source: Real-Time Innovations ( Mr. Fernando Garcia-Aranda)
  • Summary:

    The @value annotation does not fully specify the behavior. That includes:

    • The behavior for unannotated values.
    • The behavior for repeated values. Is it possible like in C++?

    DDS-XTYPES does specify the behavior of @value and such description should be added to IDL:

    7.3.1.2.1.5 Enumerated Literal Values
    Prior to this specification, it was impossible to indicate that objects of enumerated types could be stored using an integer size other than 32 bits. This specification uses the @bit_bound annotation defined in Sub Clause 8.3.4.1 of [IDL] for this purpose.

    It is important to note that the value member of the annotation may take any value from 1 to 32, inclusive, when this annotation is applied to an enumerated type. Furthermore, prior to this specification, it was impossible to provide an explicit value for an enumerated literal. The value was always inferred based on the definition order of the literals. That behavior is still supported. However, additionally, this specification allows enumerated literals to be given explicit custom values, just as they can be in the C and C++ programming
    languages. This can be done by means of the @value annotation defined in Sub Clause 8.3.1.5 of [IDL], which may be applied to individual literals.
    It is permitted for some literals in an enumerated type to bear the @value annotation while others do not. In such cases, as in C and C++ enumerations, implicit values are assigned in a progression starting from the most-recently specified value (or an implicit value of zero for the first literal, if there is no previous specified value) and adding one with each successive literal.

  • Reported: IDL4-CPP 1.0a1 — Tue, 20 Jun 2023 17:54 GMT
  • Updated: Tue, 9 Apr 2024 00:01 GMT