It's sometimes very handy to be able to get constant field values in encoders. Consider following composite type:
<composite name="Price">
<type name="mantissa" primitiveType="int64"/>
<type name="exponent" primitiveType="int8" presence="constant">-7</type>
</composite>
If you encode some price value given in double, you need to know the value of the exponent, but now there is no way to get it from an encoder.
It's sometimes very handy to be able to get constant field values in encoders. Consider following composite type:
If you encode some price value given in
double, you need to know the value of the exponent, but now there is no way to get it from an encoder.