Source: Real-Time Innovations ( Gerardo Pardo-Castellote)
The default value of an member defined with @optional is "not set".
However it is possible to also apply the @optional annotation. In this situation should the value specified in the @default override the "not set" default?
For example if MyStruct is specified as:
Would the default value of m2 be "not set" or 2?
At first glance it would seem that @default should override since if that was not the desired behavior then the user could just as well omit it. On the other hand, there seems to be a bit of ambiguity. Imagine m2 is not set by the sender, would the receiver then get "not set" or 2. If it gets 2, then how would a user ever detect the lack of m2 being set which is one of the goals of optionality.
Reported: DDS-XTypes 1.2 — Tue, 3 Jul 2018 15:27 GMT
Updated: Mon, 1 Apr 2019 17:40 GMT