Nullable Integers in Templates

Imported from previous forum

I knwo this is probably a ver simple question BUT how is a UInt32 field defined as having null support in the template defination?

If I am not mistaken, zero is the NULL value and all “real” integers are shifted by one, i.e. 0 is 1, 1 is 2 etc. on the wire. The decoder then needs to subtract 1 to provide the real value to the application. Zeor on the wire then represents the NULL value and can be given to the application in whatever way it expects to see NULL values.

I knwo this is probably a ver simple question BUT how is a UInt32 field defined as having null support in the template defination?

[ original email was from Mikael Brannstrom - mikael.brannstrom@ngm.se ]

The default value for the ‘presence’ attribute is ‘mandatory’. This is the template syntax in FAST 1.1.

Hanno is correct that when sending TheField=null it is actually sent as 0 (zero) and TheField=1 would mean that the value 2 is sent over the wire.

/Mikael

If I am not mistaken, zero is the NULL value and all “real” integers are shifted by one, i.e. 0 is 1, 1 is 2 etc. on the wire. The decoder then needs to subtract 1 to provide the real value to the application. Zeor on the wire then represents the NULL value and can be given to the application in whatever way it expects to see NULL values.

I knwo this is probably a ver simple question BUT how is a UInt32 field defined as having null support in the template defination?