Skip to content

Commit 13afeea

Browse files
committed
Merge pull request #7 from donmendelson/rc4-repeating-group
Restricted repeating group entries
2 parents 308393e + 589f597 commit 13afeea

File tree

1 file changed

+34
-5
lines changed

1 file changed

+34
-5
lines changed

v1-0-RC4/doc/03MessageStructure.md

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ The block size must be at least the sum of lengths of all fields at the
124124
root level of the message, and that is its default value. However, it
125125
may be set larger to reserve more space to effect alignment of blocks.
126126
This is specified by setting the blockLength attribute in a message
127-
schema. See section .
127+
schema.
128128

129129
### Template ID
130130

@@ -260,8 +260,9 @@ A repeating group is a message structure that contains a variable number
260260
of entries. Each entry contains fields specified by a message schema.
261261

262262
The order and data types of the fields are the same for each entry in a
263-
group. That is, the entries are homogeneous, and the position of a given
264-
field within any entry is fixed.
263+
group. That is, the entries are homogeneous. Position of a given
264+
field within any entry is fixed, with the exception of variable-length
265+
fields.
265266

266267
A message may have no groups or an unlimited number of repeating groups
267268
specified in its schema.
@@ -284,6 +285,14 @@ Example repeating group encoding specification
284285
</group>
285286
```
286287

288+
### Group block length
289+
290+
The blockLength part of a group dimension represents total space reserved
291+
for each group entry, not counting any nested repeating groups or variable-length
292+
fields. (Length of a variable-length Data field is given by its corresponding
293+
Length field.) Block length only represents message body fields; it does not
294+
include the length of the group dimension itself, which is a fixed size.
295+
287296
### Padding at end of a group entry
288297

289298
By default, the space reserved for an entry is the sum of a group’s
@@ -297,11 +306,14 @@ octets per entry. If specified, the extra space is padded at the end of
297306
each entry and should be set to zeroes by encoders. The blockLength
298307
value does not include the group dimensions itself.
299308

309+
Note that padding will only result in deterministic alignment if the
310+
repeating group contains no variable-length fields.
311+
300312
### Entry counter
301313

302314
Each group is associated with a required counter field of semantic data
303315
type NumInGroup to tell how many entries are contained by a message. The
304-
value of the counter is a non-negative integer. See section 3.4.8 below
316+
value of the counter is a non-negative integer. See "Encoding of repeating group dimensions" section below
305317
for encoding of that counter.
306318

307319
### Empty group
@@ -385,11 +397,15 @@ Implementations should support uint8 and uint16 types for repeating
385397
group entry counts. Optionally, implementations may support any other
386398
unsigned integer types.
387399

400+
By default, the minimum number of entries is zero, and the maximum number is the largest value of the primitiveType of the counter.
401+
388402
| Primitive type | Description | Length (octets) | Maximum number of entries |
389403
|----------------|-------------------------|----------------:|--------------------------:|
390404
| uint8 | 8-bit unsigned integer | 1 | 255 |
391405
| uint16 | 16-bit unsigned integer | 2 | 65535 |
392406

407+
The number of entries may be restricted to a specific range; see "Restricting repeating group entries" below.
408+
393409
#### Encoding of repeating group dimensions
394410

395411
Conventionally in FIX, a NumInGroup field conveys the number of entries
@@ -416,6 +432,19 @@ Wire format of NumInGroup with block length 55 octets by 3 entries
416432

417433
`37000300`
418434

435+
#### Restricting repeating group entries
436+
437+
The occurrences of a repeating group may be restricted to a specific range by modifying the numInGroup member of the group dimension encoding. The minValue attribute controls the minimum number of entries, overriding the default of zero, and the maxValue attribute restricts the maximum entry count to something less than the maximum corresponding to its primitiveType. Either or both attributes may be specified.
438+
439+
Example of a restricted group encoding
440+
441+
```xml
442+
<composite name="restrictedGroupSizeEncoding">
443+
<type name="blockLength" primitiveType="uint16"/>
444+
<type name="numInGroup" primitiveType="uint16" semanticType="NumInGroup" minValue="1" maxValue="10" />
445+
</composite>
446+
```
447+
419448
Sequence of message body elements
420449
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
421450

@@ -459,4 +488,4 @@ to the session protocol.
459488
| Wrong message size in header | A message size value smaller than the actual message may cause a message to be truncated. |
460489
| Wrong or unknown template ID in header | A mismatch of message schema would likely render a message unintelligible or cause fields to be misinterpreted. |
461490
| Fixed-length field after repeating group or variable-length field | All fixed-length fields in the root of a message or in a repeating group entry must be listed before any (nested) repeating group or variable-length field. |
462-
| Repeating group after variable-length field | All repeating groups at the root level or in a nested repeating group must be listed before any variable length field at the same level. |
491+
| Repeating group after variable-length field | All repeating groups at the root level or in a nested repeating group must be listed before any variable length field at the same level. |

0 commit comments

Comments
 (0)