Source: OCI ( Adam Mitz)
In Table 9 " Default values for non-optional members".
For type kind UNION_TYPE, the default value may require the discriminator to be set to the "lowest value associated with any member", however the "lowest" relation isn't defined for all possible discriminator types.
Boolean: use false (based on Table 9)
Byte: undefined (based on Table 3)
UInt<N>: well defined
Int<N>: need to define/clarify for negative numbers
Enum: treat as Int32 per Table 4
Reported: DDS-XTypes 1.2b1 — Thu, 14 Dec 2017 20:17 GMT
Disposition: Resolved — DDS-XTypes 1.3
Modify the definition of the UNION_TYPE default value
In table 9 set the union according to these rules:
- Set the discriminator to the default value for the discriminator type
- If that discriminator value does not select a branch, then there is nothing else to set
- If that discriminator value selects a branch, then set the selected member to the default value for that corresponding member type
Note that even if there is no explicit "default" brach, it is still possible to set discriminator to a value they is not covered in the explicit cases. This selects the so-called "implicit" default which has an empty branch.
Updated: Tue, 8 Oct 2019 17:55 GMT