Imported from previous forum
Hi FAST community, thanks for your assistance…
I don’t see anywhere that delta encodings, such as ASCIIStringDelta are defined. This grammar from section 10 is not complete:
stream ::= message* | block*
block ::= BlockSize message+
message ::= segment
segment ::= PresenceMap TemplateIdentifier? (field | segment)*
field ::= integer | string | delta | ScaledNumber | ByteVector integer ::= UnsignedInteger | SignedInteger
string ::= ASCIIString | UnicodeString
delta ::= IntegerDelta | ScaledNumberDelta | ASCIIStringDelta | ByteVectorDelta
Specifically, I’m looking for the delta encodings. ASCIIStringDelta, for example is referenced in 6.3.7.3:
“The delta value is represented as an ASCII String Delta in the transfer encoding. The subtraction length of the delta specifies the number of characters to remove from the front or back of the base value. Characters are removed from the front when the subtraction length is negative. The string part of the delta value represents the characters to add to the same end of the base value as specified by the sign of the subtraction length.”
Specifically, is subtraction length a prefixed integer length, or is it the length of the delta string?
More generally, though, where are these formally defined (the transfer encoding link in the basic user’s guide is broken)?
TIA
jeff
Jeff,
an ASCII string delta is represented on the wire by an integer followed by a string. The string is an SBIT-encoded value, so the length of the string can be deduced without a separate length entry.
The integer is interpreted as a subtraction length, ie. how many characters to remove from the previous value before inserting the string. The substraction length is represented as excess-1 when the value is negative (in order to express negative zero).
A few examples (1|“foo” means integer followed by string):
prev — wire ---- value — comment -----------------
"" 0|“abc” “abc” remove 0 chars, add “abc” at end
"abc" 1|“a” “aba” remove 1 char, add “a” at end
"aba" -1|“d” “daba” remove 0 chars, add “d” at front
"daba" -3|“dc” “dcba” remove 2 chars, add “dc” at front
BTW, what’s your company affiliation?
/Rolf
Jeff,
an ASCII string delta is represented on the wire by an integer followed
by a string. The string is an SBIT-encoded value, so the length of the
string can be deduced without a separate length entry.The integer is interpreted as a subtraction length, ie. how many
characters to remove from the previous value before inserting the
string. The substraction length is represented as excess-1 when the
value is negative (in order to express negative zero).A few examples (1|“foo” means integer followed by string):
prev — wire ---- value — comment ----------------- “” 0|“abc” “abc”
remove 0 chars, add “abc” at end “abc” 1|“a” “aba” remove 1 char, add
“a” at end “aba” -1|“d” “daba” remove 0 chars, add “d” at front “daba”
-3|“dc” “dcba” remove 2 chars, add “dc” at frontBTW, what’s your company affiliation?
/Rolf
Thanks Rolf,
I guess there is no formal grammar definition for delta’s then?
I’m with Object Computing: http://www.ociweb.com
jeff
no, there’s no formal grammar definition for deltas.
We didn’t get around to including a complete grammar spec when we compiled the FAST 1.1 specification. There was a lot of discussion on how we should specify the grammar and we decided in the end to go with the rather informal language used in the spec. If you have time and interest you can always contribute a grammar spec. I’m sure it will be greatly appreciated by the community.
/Rolf
Thanks Rolf,
I guess there is no formal grammar definition for delta’s then?
I’m with Object Computing: http://www.ociweb.comjeff
They’re defined in the document but are treated as terminal symbols in the grammar. The definition of the terminal symbols that you find in the delta production:
delta ::= IntegerDelta | ScaledNumberDelta | ASCIIStringDelta | ByteVectorDelta
are in section 10.7 of the specification.
So I think the informality would be then that it is not explicitly stated that terminal symbols are defined elsewhere in the document and that they appear with whitspace in the section headings.
/David
no, there’s no formal grammar definition for deltas.
We didn’t get around to including a complete grammar spec when we
compiled the FAST 1.1 specification. There was a lot of discussion on
how we should specify the grammar and we decided in the end to go with
the rather informal language used in the spec. If you have time and
interest you can always contribute a grammar spec. I’m sure it will be
greatly appreciated by the community./Rolf
Thanks Rolf,
I guess there is no formal grammar definition for delta’s then? I’m
with Object Computing: http://www.ociweb.comjeff
Will you always receive a string after the subtraction length?
There is no previous value in the cache.
I get a zero subtraction length and this is the last byte of the packet.
Jeff,
an ASCII string delta is represented on the wire by an integer followed
by a string. The string is an SBIT-encoded value, so the length of the
string can be deduced without a separate length entry.The integer is interpreted as a subtraction length, ie. how many
characters to remove from the previous value before inserting the
string. The substraction length is represented as excess-1 when the
value is negative (in order to express negative zero).A few examples (1|“foo” means integer followed by string):
prev — wire ---- value — comment ----------------- “” 0|“abc” “abc”
remove 0 chars, add “abc” at end “abc” 1|“a” “aba” remove 1 char, add
“a” at end “aba” -1|“d” “daba” remove 0 chars, add “d” at front “daba”
-3|“dc” “dcba” remove 2 chars, add “dc” at frontBTW, what’s your company affiliation?
/Rolf
Joseph,
Is it an optional string delta field?
If so, a zero (0x80) byte would indicate a NULL field. There is no string value following in the NULL case. [see spec section 10.7.3]
Hope this helps,
Rolf
Will you always receive a string after the subtraction length?
There is no previous value in the cache. I get a zero subtraction
length and this is the last byte of the packet.
Rolf,
Thanks I missed that in the spec. You are correct it is optional.
Does this mean if there was a value in the cache that I should use it?
Say the field was not optional and subtraction length was zero would this be an error?
Thanks,
Joseph
Joseph,
Is it an optional string delta field?
If so, a zero (0x80) byte would indicate a NULL field. There is no
string value following in the NULL case. [see spec section 10.7.3]Hope this helps, Rolf
Will you always receive a string after the subtraction length? There
is no previous value in the cache. I get a zero subtraction length and
this is the last byte of the packet.
Joseph,
no, the value in the previous value cache should not be used.
yes, it would be an error if the field was not optional.
/Rolf
Rolf, Thanks I missed that in the spec.
You are correct it is optional. Does this mean if there was a
value in the cache that I should use it?
Say the field was not optional and subtraction length was zero would
this be an error?Thanks, Joseph
Joseph,
Is it an optional string delta field?
If so, a zero (0x80) byte would indicate a NULL field. There is no
string value following in the NULL case. [see spec section 10.7.3]Hope this helps, Rolf
Rolf,
so we have an optional delta string.
The cache has AB
subtraction length on wire is 0x81 which is subtraction length 1
string on wire is 0x80 which is string 0x00
If I understand this correctly the result should be A
Thanks, Joseph
Joseph,
no, the value in the previous value cache should not be used. yes, it
would be an error if the field was not optional./Rolf
Rolf, Thanks I missed that in the spec. You are correct it is
optional. Does this mean if there was a value in the cache that I
should use it? Say the field was not optional and subtraction length
was zero would this be an error?Thanks, Joseph
Joseph,
Is it an optional string delta field?
If so, a zero (0x80) byte would indicate a NULL field. There is no
string value following in the NULL case. [see spec section 10.7.3]Hope this helps, Rolf
Joseph,
if you have an optional delta string then 0x81 is +0 (zero). String data of 0x80 means “empty string” [section 10.6.3] so the result is “AB”.
/Rolf
Rolf, so we have an optional delta string. The cache has AB
subtraction length on wire is 0x81 which is subtraction
length 1 string on wire is 0x80 which is string 0x00.
If I understand this correctly the result should be A
Thanks, Joseph