[This message was posted by David Rosenborg of Pantor Engineering AB <[email protected]> to the "FAST Protocol" discussion forum at http://fixprotocol.org/discuss/46. You can reply to it on-line at http://fixprotocol.org/discuss/read/c10621a7 - PLEASE DO NOT REPLY BY MAIL.]
The template identifier is logically mandatory, that is, the decoder must always know the TID in order to decode the message. However, the TID is not present in the stream for every message since it uses an implicit copy operator. This implicit copy operator always allocates the first bit in the presence map. If the bit is 1, then the TID is present in the stream, and if the bit is 0, then the TID is the same as the TID of the previous message. Another thing to note is that a presence map has variable length and will always be as long as necessary to accommodate all the required bits, but not longer. If the fields of your template require seven bits, then the maximum number of bits in the PMAP will be eight since the TID copy operator uses the first bit. This means that the PMAP will be one or two bytes depending of the value of the last bit. If it is 1, then a two byte PMAP is used and if it is 0, then a single byte is used since trailing zeroes are truncated. The text you've quoted describes two different types of segments, those used at the message level, which have a TID, and those used in groups and sequences which don't have a TID. The word "optional" here refers to that difference. /David > I have a template with seven things in it and the first time I get it I > get the presence map in one byte. There is no space for the template id > to be in the pmap and the template id is sent. Yet I am told that the > template id is optional and may be in the first bit. Sometimes I am > getting funny looking pmaps and no template id. > > How does this work... > > I can see this in the document: > > A segment has a header consisting of a Presence Map followed by an > optional Template Identifier. The segment has a template identifier > either if it is a message segment, or if the segment appears as the > result of a dynamic template reference instruction. A template > identifier is encoded as if a copy operator was specified. The > operator uses the global dictionary and has an internal key common to > all template identifier fields. This means that a segment with a > template identifier does not always contain the template identifier > physically. However, the first bit in the presence map is allocated by > its copy operator. > > But I have no idea what it means... > > Sorry please help... [You can unsubscribe from this discussion group by sending a message to mailto:[email protected]] --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Financial Information eXchange" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/FIX-Protocol?hl=en -~----------~----~----~----~------~----~------~--~---
