Previous value

Imported from previous forum

Hello,

Can you please make clear some “previous value” update rules.

There are some situations which are ambiguous in documentation (at least from me).

Field :

Situation :

  • No value in the stream.

  • No initial value.

Documentation :

“If the field has optional presence and no initial value, the field is
considered absent when there is no value in the stream.”

Questions :

What is “considered absent”?
Should decoder put the “empty” value to “previous value” dictionary in this case?

Field :

Situation :

  • NULL value is decoded (“0” in stream).

Documentation :

“…it is encoded with a nullable representation and the NULL is used to represent absence of a value”.

Questions :

Should decoder put the “empty” value to “previous value” dictionary in this case?

Field :

	<decimal name="3"> <constant value="1" /> </decimal>

Situation :

  • Value is not present in the stream.

Documentation :

“If the bit is not set, the value is considered absent.”

Questions:

Should decoder put the “empty” value to “previous value” dictionary in this case?

Field :

	<decimal name="4"> <constant value="1" /> </decimal>

Situation :

  • Value is present in the stream.

Documentation :

“If the bit is set, the value is the initial value in the instruction context”

Questions:

Should decoder put the “initial” value to “previous value” dictionary in this case?

Field :

Situation :

  • No value in the stream.

Questions :

Should decoder return the NULL value in this case?

Should decoder put the “empty” value to “previous value” dictionary in this case?

Thank you!

Roman.

See comments below

Field :

Situation :

  • No value in the stream.

  • No initial value.

Documentation :

“If the field has optional presence and no initial value, the field is
considered absent when there is no value in the stream.”

Questions :

What is “considered absent”? Should decoder put the “empty” value to
“previous value” dictionary in this case?

The default operator doesn’t make use of a dictionary and therefore there is no previous value in this case.

“Considered absent” simply means that the value is not there from from an application point of view. Depending on how your interface is implemented, this may be conveyed by the means of a special NULL value.

A default operator, with no initial value, specified for an optional field means that the default value in effect is NULL.

Field :

Situation :

  • NULL value is decoded (“0” in stream).

Documentation :

“…it is encoded with a nullable representation and the NULL is used
to represent absence of a value”.

Questions :

Should decoder put the “empty” value to “previous value” dictionary in
this case?

Since no operator is specified, this field doesn’t make use of the dictionary and hence there is no previous value to modify.

Field :

            <decimal name="3"> <constant value="1" /> </decimal>

Situation :

  • Value is not present in the stream.

Documentation :

“If the bit is not set, the value is considered absent.”

Questions:

Should decoder put the “empty” value to “previous value” dictionary in
this case?

The constant operator doesn’t use the dictionary either.

Field :

            <decimal name="4"> <constant value="1" /> </decimal>

Situation :

  • Value is present in the stream.

Documentation :

“If the bit is set, the value is the initial value in the
instruction context”

Questions:

Should decoder put the “initial” value to “previous value” dictionary
in this case?

See 4.

Field :

Situation :

  • No value in the stream.

Questions :

Should decoder return the NULL value in this case?

Should decoder put the “empty” value to “previous value” dictionary in
this case?

There must always be a value, the delta, in the stream when using the delta operator. A delta operator will never assign the state “empty” to a dictionary entry. For the delta operator it is an error if the state of the previous value is “empty”.

When using the delta operator for an optional field, and NULL appears in the stream, the value is logically absent from the application point of view, and the previous value should be left untouched.

/D

Hello,

Thanks a lot!

Please make more exact this questions.

The default operator doesn’t make use of a dictionary and therefore there is no previous value in this case.

Since no operator is specified, this field doesn’t make use of the dictionary
and hence there is no previous value to modify.

The constant operator doesn’t use the dictionary either.

Is it correct : “The CONSTANT, DEFAULT and NONE operators NEVER change the previous value” ?

I.e. for ex. there are the following templates :

Step 1. Decoder received the “template1” message. Value is present in stream.
However it not stored as “previous value” because
“the default operator doesn’t make use of a dictionary”.

Step 2. Decoder receved the “template2” message.
So DELTA operator will not use value decoded on “Step 1”.

Is it correct?

Roman.

Yes, it’s correct.

/David

Hello,

Thanks a lot!

Please make more exact this questions.

The default operator doesn’t make use of a dictionary and therefore
there is no previous value in this case.

Since no operator is specified, this field doesn’t make use of the
dictionary and hence there is no previous value to modify.

The constant operator doesn’t use the dictionary either.

Is it correct : “The CONSTANT, DEFAULT and NONE operators NEVER change
the previous value” ?

I.e. for ex. there are the following templates :



Step 1. Decoder received the “template1” message. Value is present in
stream. However it not stored as “previous value” because “the default
operator doesn’t make use of a dictionary”.

Step 2. Decoder receved the “template2” message. So DELTA operator will
not use value decoded on “Step 1”.

Is it correct?

Roman.