Imported from previous forum
Hi,
I am testing my FAST implementation and have a question.
Here is a test from examples:
Copy Operator Example for NULL – Optional String
Input Value Prior Value Encoded Value Pmap Bit FAST Hex/Binary
None None Null 1 0x80 (10000000)
…
But specification says that when the value is not present int the stream, previous value is undefined and the field has optional presence the field is considered absent and the state of the previous value is changed to empty.
It is correct to write nothing into output stream? In this case the sample will be:
Input Value Prior Value Encoded Value Pmap Bit FAST Hex/Binary
None None None 0 None
And other question about previous values: should encode/decode methods use the same previous value?
For instance if I received field “Flag” from example above, it’s value is “CME” and I want to send back the same value “CME”. Will the previous value be undefined or it will be “CME”?
Hi Konstantin,
I’ll let David respond to the first question.
Re: your second question:
Should encode/decode methods use the same previous value?
For instance if I received field “Flag” from example above,
it’s value is “CME” and I want to send back the same value
“CME”.
Will the previous value be undefined or it will be “CME”?"
I believe you are asking if your encoder and decoder share
the same previous value state. The answer is no.
You should view your outgoing and incoming message streams as
two separate streams, each with its own previous value state.
As a consequence, your encoder previous value state will be
undefined in the example above.
(Obviously, your encoder must share state with the decoder at
the other end (and vice versa) or you will have trouble with
agreeing on values for fields with operators)
Best,
Rolf
Hi,
I am testing my FAST implementation and have a question.
Here is a test from examples:
Copy Operator Example for NULL – Optional String Input Value Prior
Value Encoded Value Pmap Bit FAST Hex/Binary None None Null 1 0x80
(10000000) …But specification says that when the value is not present int the
stream, previous value is undefined and the field has optional
presence the field is considered absent and the state of the
previous value is changed to empty.It is correct to write nothing into output stream? In this case
the sample will be: Input Value Prior Value Encoded Value Pmap
Bit FAST Hex/Binary None None None 0 NoneAnd other question about previous values: should encode/decode
methods use the same previous value? For instance if I received
field “Flag” from example above, it’s value is “CME” and I want
to send back the same value “CME”. Will the previous value be
undefined or it will be “CME”?
The example is correct, but the encoding you suggest is also allowed and more optimal in this case.
/David
Copy Operator Example for NULL – Optional String Input Value Prior
Value Encoded Value Pmap Bit FAST Hex/Binary None None Null 1 0x80
(10000000) …But specification says that when the value is not present int the
stream, previous value is undefined and the field has optional presence
the field is considered absent and the state of the previous value is
changed to empty.It is correct to write nothing into output stream? In this case the
sample will be: Input Value Prior Value Encoded Value Pmap Bit FAST
Hex/Binary None None None 0 None
Thanks, David.
There is another example which is incorrect in my opinion - Delta Operator Example – Mandatory Decimal.
As far as I understand we store the whole decimal as previous value. But here only mantissa is used and exponent is always transferred explicitly.
But delta operator definition says:
“The delta value is represented as two Signed Integers. The first integer is the delta for the exponent and the second is the delta for the mantissa.”
So as long as exponent isn’t changed - the first signed integer must be zero (not -2).
Thanks,
Konstantin Stepanyuk
The example is correct, but the encoding you suggest is also allowed and
more optimal in this case./David
Copy Operator Example for NULL – Optional String Input Value Prior
Value Encoded Value Pmap Bit FAST Hex/Binary None None Null 1 0x80
(10000000) …But specification says that when the value is not present int the
stream, previous value is undefined and the field has optional
presence the field is considered absent and the state of the previous
value is changed to empty.It is correct to write nothing into output stream? In this case the
sample will be: Input Value Prior Value Encoded Value Pmap Bit FAST
Hex/Binary None None None 0 None
Assuming you refer to example 2.5.2 (version 08 of the document), the example is correct. The table shows that the second and third deltas transferred use a zero delta for the exponent and -4 and -5 for the mantissa deltas respectively.
How you choose to store the previous value is implementation dependent, but in order to handle the delta operator correctly, an implementation must know how to extract the exponent and mantissa parts exactly as they were after the previous transfer and possible operator application.
/David
Thanks, David.
There is another example which is incorrect in my opinion - Delta
Operator Example – Mandatory Decimal.As far as I understand we store the whole decimal as previous value. But
here only mantissa is used and exponent is always transferred
explicitly.But delta operator definition says: “The delta value is represented as
two Signed Integers. The first integer is the delta for the exponent and
the second is the delta for the mantissa.”So as long as exponent isn’t changed - the first signed integer must be
zero (not -2).
Thank you, David.
I used examples version 07. Last version is really correct.
Is there a possibility to notify this mailgroup subscribers about related document updates?
Regards
Konstantin Stepnayuk
Assuming you refer to example 2.5.2 (version 08 of the document), the
example is correct. The table shows that the second and third deltas
transferred use a zero delta for the exponent and -4 and -5 for the
mantissa deltas respectively.How you choose to store the previous value is implementation dependent,
but in order to handle the delta operator correctly, an implementation
must know how to extract the exponent and mantissa parts exactly as they
were after the previous transfer and possible operator application./David
Thanks, David.
There is another example which is incorrect in my opinion - Delta
Operator Example – Mandatory Decimal.As far as I understand we store the whole decimal as previous value.
But here only mantissa is used and exponent is always transferred
explicitly.But delta operator definition says: “The delta value is represented as
two Signed Integers. The first integer is the delta for the exponent
and the second is the delta for the mantissa.”So as long as exponent isn’t changed - the first signed integer must
be zero (not -2).