Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blockLength for repeating groups of variable length #8

Closed
2pl opened this issue Dec 2, 2015 · 3 comments
Closed

blockLength for repeating groups of variable length #8

2pl opened this issue Dec 2, 2015 · 3 comments

Comments

@2pl
Copy link

2pl commented Dec 2, 2015

How can I deal with repeating groups when occurrences differ in length ?
I have no guarantee that all occurrence of a repeating group have the same length:

  • repeating group has a variable length field defined: length of variable field can vary
  • repeating group has a nested repeating group: number of occurrences of nested group can vary

But in the dimension of the repeating group block, I need to specify a unique value for the length.

So I guess the implied constraint is I MUST ensure that all occurrences have the same length ?

@donmendelson
Copy link
Member

Both fixed length and variable length repeating group entries are supported by the RC3 standard (but not RC2). The blockLength field in the group dimension specifies the total size of fixed-length fields in an entry. Any variable length elements are in addition to blockLength, but they contain there own size. Variable length string fields are prefixed by length, and nested repeating groups contain their own group dimension.

If a repeating group contains no variable length elements, then all entries will be the same length, and a decoder may directly access each entry since its position is deterministic.

On the other hand, if a group does contain variable length fields or nested groups, a decoder must walk every preceding block to access a particular entry in order to discover each block's length.

@2pl
Copy link
Author

2pl commented Dec 3, 2015

Ok, that makes sense, but worth adding clarification in 3.4.9 Group Dimension encoding IMHO.
I would suggest replacing 'space reserved for each entry' with 'space reserved for the fixed-length fields in an entry'.

3.4.9 Group dimension encoding
Every repeating group must be immediately preceded on the wire by its dimensions. The two dimensions are the count of entries in a repeating group and the space reserved for each entry of the group.

@donmendelson
Copy link
Member

Agreed. The spec explains this for blockLength of the root block but not for repeating groups. (Previously, this was a moot point since in RC2, variable length fields were not allowed in repeating groups, but in RC3 they are.)

donmendelson added a commit to donmendelson/fix-simple-binary-encoding that referenced this issue Dec 3, 2015
Explain blockLength for repeating groups of variable length FIXTradingCommunity#8
donmendelson added a commit to donmendelson/fix-simple-binary-encoding that referenced this issue Dec 3, 2015
blockLength for repeating groups of variable length FIXTradingCommunity#8
donmendelson added a commit that referenced this issue Jan 21, 2016
Spell out project name or issue #8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants