Closed adkapur closed 8 years ago
Does the NumInGroup (number of entries) of the outer repeating group include an entry for the nested repeating group?
No, the NumInGroup of the outer group only give the number of occurrences of the outer group. The NumInGroup of the inner group gives its count. They are independent of each other.
Also while encoding do we have to first encode all entries of the outer repeating group followed by the nested repeating group?
No, what you have describe is breadth-first. Rather, a depth-first walk means you visit all nested groups of the first branch before moving to the second branch. If the groups were nested three deep, you would visit branch 1 of the outer group, then the first branch of the second level group, then all occurrences of the innermost group off of branch 1-1. Then the same pattern for branch 2 off the first branch of the outer group, etc. In other words, you go from trunk to the first leaf before going back to the second branch, and you follow the second branch all the way to its leaves before the third branch. Does that help explain it? If not, I guess a picture is needed.
There is a picture here: https://en.wikipedia.org/wiki/Depth-first_search
If the diagram were a representation of a FIX message, each non-leaf node would contain a NumInGroup (group dimension).
Hi Don, Do you know if Real Logic SBE encoder supports nested repeating groups?
@RFrenkel I believe the answer is yes, but you should post that question to real-logic/simple-binary-encoding.
Got it thanks
Yes the Real Logic SBE encoder does support nested repeating groups.
Great! Thank you, Martin!
I just had a quick question regarding the use of nested repeating groups. Does the NumInGroup (number of entries) of the outer repeating group include an entry for the nested repeating group? I know that the blockLength of the outer group excludes it but I was not sure about the NumInGroup.
Also while encoding do we have to first encode all entries of the outer repeating group followed by the nested repeating group? What does this statement in the specification mean?
"Nested repeating groups are encoded on the wire by a depth-first walk of the data hierarchy. For example, all inner entries under the first outer entry must be encoded before encoding outer entry 2. (This is the same element order as FIX tag=value encoding.)"
Wouldn't the nested repeating group be at the end of the outer repeating group so this would be encoded at the end after all of the preceding outer group entries have been encoded?
Example of nested repeating group specification:
group name="ListOrdGrp" id="2030" field name="ClOrdID" id="11" type="string14" semanticType="String"/ field name="ListSeqNo" id="67" type="uint32" semanticType="int"/ field name="Symbol" id="55" type="string8" semanticType="String"/ field name="Side" id="54" type="char" semanticType="char"/ field name="OrderQty" id="38" type="intQty32" semanticType="Qty"/ group name="Parties" id="1012" field name="PartyID" id="448" type="string14" semanticType="String"/ field name="PartyRole" id="452" type="int" semanticType="int"/ /group /group