Imported from previous forum
I’m trying to encode stream of messages with the same message template along with FastReset message.
Standatd suggests to encode message template id as uint with “Copy” operator.
My implementation uses dictionary of previous values, independent for each message template.
Structure:
Encoder:
array of MessageTemplates
array of FieldTemplates
array of PreviousValues (dictionary)
In this case for messages stream “msg1, msg1, FastReset,msg1, msg1, FastReset” message template ids will be encoded in this way:
1: message template id for msg1 will be tranferred (dictionary=dictionaries[msg1]).
2: since message template id for msg1 equal with message template id from the first message and operator is “Copy”, id will not be tranferred
(dictionary=dictionaries[msg1]).
3: message template id for FastReset will be tranferred (dictionary=dictionaries[FastReset]).
4: since message template id for msg1 equal with message template id from the second message, id will not be tranferred (dictionary=dictionaries[msg1]).
5: since message template id for msg1 equal with message template id from the fourth message, id will not be tranferred (dictionary=dictionaries[msg1]).
6: since message template id for msg1 equal with message template id from the third message, id will not be tranferred (dictionary=dictionaries[FastReset]).
Should I keep only one dictionary for all message templates or send message template id with operator “None” (always tranfer), or there are some other ways to handle tranfer of message template id?
It sounds like you’re developing a FAST 1.0 application. I’d strongly suggest you consider using the FAST 1.1 specification as a base instead, even if you plan to communicate with 1.0 decoders. There’s a subset of 1.1 that is compatible with 1.0.
In FAST 1.1 the template identifier is required to appear at the start of each message with an implicit copy operator. The implicit type of this field is uInt32.
Since a reset is defined to reset all dictionary entries, including the entry for the TID, you must retransmit the TID for the third instance of msg1. So this means that step 4 and 6 in your example must change. For example, in step 4, a decoder has no way of knowing that the TID should be copied from the two messages back instead of the immediately preceding when the presence bit is not set.
The behavior of the TID field cannot be modified, it always uses the copy operator. However, the dictionaries used for other operators in a template can be modified through the dictionary attribute in the XML syntax:
This is the default, it means all fields uses the same dictionary.
This means that a dictionary specific to the current template is used
This means that a dictionary specific to the current message type is used. The message type is specified by the element. This is useful when multiple templates are used to represent the same message type.
FAST 1.0 only supports the “global” dictionary case, so if you plan to stay in the 1.0 compatibility subset, you should stick with the default.
/David
I’m trying to encode stream of messages with the same message template
along with FastReset message. Standatd suggests to encode message
template id as uint with “Copy” operator. My implementation uses
dictionary of previous values, independent for each message template.
Structure: Encoder: array of MessageTemplates array of FieldTemplates
array of PreviousValues (dictionary)In this case for messages stream “msg1, msg1, FastReset,msg1, msg1,
FastReset” message template ids will be encoded in this way:1: message template id for msg1 will be tranferred
(dictionary=dictionaries[msg1]).
2: since message template id for msg1 equal with message template id
from the first message and operator is “Copy”, id will not be
tranferred (dictionary=dictionaries[msg1]).
3: message template id for FastReset will be tranferred
(dictionary=dictionaries[FastReset]).
4: since message template id for msg1 equal with message template id
from the second message, id will not be tranferred
(dictionary=dictionaries[msg1]).
5: since message template id for msg1 equal with message template id
from the fourth message, id will not be tranferred
(dictionary=dictionaries[msg1]).
6: since message template id for msg1 equal with message template id
from the third message, id will not be tranferred
(dictionary=dictionaries[FastReset]).Should I keep only one dictionary for all message templates or send
message template id with operator “None” (always tranfer), or there are
some other ways to handle tranfer of message template id?