Interpretation of 10.5.1 wrt COPY and INCREMENT

Imported from previous forum

In Section 10.5.1 of the Fast 1.1 Specification, the description of copy and increment operators for optional integer, decimal, string and byte vector fields says that ,

“If set, the value appears in the stream in a nullable representation. A NULL indicates that the value is absent and the state of the previous value is set to empty …”

(note that I have elided the description of default, as I believe that I understand it).

My interpretation of this sentence in combination with Sections 6.3.5 and 6.3.6 is that the field is considered present as far as interpretation of the previous value (i.e., the rules in 6.3.5 and 6.3.6 for when a value is not present in the stream do not apply).

So, for an optional field with the copy or increment operator, if the present bit is set, but the value in the stream is null, the previous value is set to empty, and a “null” value (however that is represented in the API) is returned; the existing previous value does not play into the calculation of the result. However, if the present bit is not set, then the rules in 6.3.5 and 6.3.6 for when a value is not present in the stream are applied.

Thanks,

Jim Walker
RGM Advisors, LLC

Just to be clear, I am asking if my interpretation is correct.

Thanks,

Jim Walker
RGM Advisors, LLC

Every time the bit is set for the copy and increment operators, the previous value is updated. If the value read from the byte stream was NULL, then the previous value in effect becomes NULL (i.e. its state becomes empty). And it will stay NULL until the previous value is updated the next time.

/David

In Section 10.5.1 of the Fast 1.1 Specification, the description of copy and increment operators for optional integer, decimal, string and byte vector fields says that ,

“If set, the value appears in the stream in a nullable representation. A NULL indicates that the value is absent and the state of the previous value is set to empty …”

(note that I have elided the description of default, as I believe that I understand it).

My interpretation of this sentence in combination with Sections 6.3.5 and 6.3.6 is that the field is considered present as far as interpretation of the previous value (i.e., the rules in 6.3.5 and 6.3.6 for when a value is not present in the stream do not apply).

So, for an optional field with the copy or increment operator, if the present bit is set, but the value in the stream is null, the previous value is set to empty, and a “null” value (however that is represented in the API) is returned; the existing previous value does not play into the calculation of the result. However, if the present bit is not set, then the rules in 6.3.5 and 6.3.6 for when a value is not present in the stream are applied.

Thanks,

Jim Walker
RGM Advisors, LLC

Thank you, David. Your explanation makes more sense to me than what I was reading in the specification.

Jim Walker

Every time the bit is set for the copy and increment operators, the previous value is updated. If the value read from the byte stream was NULL, then the previous value in effect becomes NULL (i.e. its state becomes empty). And it will stay NULL until the previous value is updated the next time.

/David

You’re interpretation is correct, although rather than saying “a ‘null’ value is returned” I would say it differently.

If the decoder is pushing data to the application, I’d say: “No value at all is passed to the application.”

If the application is pulling data from a decoded message, I would say: “When the application asks if a value is available (which it must be able to do because this is an optional field) the answer is ‘no’.”

The reason I am quibbling is that in general there is no ‘null’ value that could be returned for an integer. All possible bit patterns represent valid integers (although there may be “obviously invalid” integers that could be used in particular cases.)

You might wish to take a look at this page: Google Code Archive - Long-term storage for Google Code Project Hosting.

It’s the cheat-sheet I used when I was developing QuickFAST and I referred to it often.

Dale

In Section 10.5.1 of the Fast 1.1 Specification, the description of copy and increment operators for optional integer, decimal, string and byte vector fields says that ,

“If set, the value appears in the stream in a nullable representation. A NULL indicates that the value is absent and the state of the previous value is set to empty …”

(note that I have elided the description of default, as I believe that I understand it).

My interpretation of this sentence in combination with Sections 6.3.5 and 6.3.6 is that the field is considered present as far as interpretation of the previous value (i.e., the rules in 6.3.5 and 6.3.6 for when a value is not present in the stream do not apply).

So, for an optional field with the copy or increment operator, if the present bit is set, but the value in the stream is null, the previous value is set to empty, and a “null” value (however that is represented in the API) is returned; the existing previous value does not play into the calculation of the result. However, if the present bit is not set, then the rules in 6.3.5 and 6.3.6 for when a value is not present in the stream are applied.

Thanks,

Jim Walker
RGM Advisors, LLC