Template Reference Instruction

Imported from previous forum

Hi all,

I want clarification regarding Template Reference Instruction.
It is a global dictionary.
We have template as

(template name=“Template_1” id=“1” dictionary=“1” xmlns=“http://www.fixprotocol.org/ns/fast/td/1.1”)
.
.
(uInt32 name=“MDEntrySize” id=“271” presence=“optional”)
(copy value=“100”/)
(/uInt32)
(templateRef name=“MarketDataIncrementalRefresh”/)
.
.
(/template)

(template name=“Template_2” id=“2” dictionary=“2” xmlns=“http://www.fixprotocol.org/ns/fast/td/1.1”)
(typeRef name=“MarketDataIncrementalRefresh”/)
.
.
(uInt32 name=“MDEntrySize” id=“271” presence=“optional”)
(copy value=“150”/)
(/uInt32)
.
.
(/template)

Template_1 is having Static Template Reference of Template_2.
(Whether my understanding is correct, that using [typeRef name=“MarketDataIncrementalRefresh”/], Template_2 will be statically referenced with Template_1?)

We got message for Template_1

PMAP Bit is ‘1’ for field 271 (of Template_1)
Value is 200

PMAP Bit is ‘0’ for field 271 (of Template_2)
Value for field 271 is not present in stream.
According to my understanding, decoded value of field 271 (of Template_2) will be 200 (as previous value of field 271 is 200 and it is global dictionary).

or decoded value of field 271 (of Template_2) will be 150 (as in Template_2, initial value is 150).
I am not clear.

Thanks & regards
Shashank

The name in a static template reference should be the name of another template so in your example you’d have to write (templateRef name=“Template_2”/).

If we assume you do that, Template_1 will include two fields with the same name MDEntrySize. Even if it’s not prohibited by the specification, it doesn’t make much sense in a real application. Depending on your implementation the second occurrence would probably overwrite the first (if it works at all).

In any case, the correct behavior for the two fields would be to have two different pmap bits but they would share the same entry in the global dictionary (since they have the same name).

/David

Hi all,

I want clarification regarding Template Reference Instruction. It is a
global dictionary. We have template as

(template name=“Template_1” id=“1” dictionary=“1”
xmlns=“http://www.fixprotocol.org/ns/fast/td/1.1”)
.
. (uInt32 name=“MDEntrySize” id=“271” presence=“optional”) (copy
value=“100”/) (/uInt32) (templateRef
name=“MarketDataIncrementalRefresh”/)
.
. (/template)

(template name=“Template_2” id=“2” dictionary=“2”
xmlns=“http://www.fixprotocol.org/ns/fast/td/1.1”) (typeRef
name=“MarketDataIncrementalRefresh”/)
.
. (uInt32 name=“MDEntrySize” id=“271” presence=“optional”) (copy
value=“150”/) (/uInt32)
.
. (/template)

Template_1 is having Static Template Reference of Template_2. (Whether
my understanding is correct, that using [typeRef
name=“MarketDataIncrementalRefresh”/], Template_2 will be statically
referenced with Template_1?)

We got message for Template_1

PMAP Bit is ‘1’ for field 271 (of Template_1) Value is 200

PMAP Bit is ‘0’ for field 271 (of Template_2) Value for field 271 is not
present in stream. According to my understanding, decoded value of field
271 (of Template_2) will be 200 (as previous value of field 271 is 200
and it is global dictionary).

or decoded value of field 271 (of Template_2) will be 150 (as in
Template_2, initial value is 150). I am not clear.

Thanks & regards Shashank

Thank you David.

Shashank