Skip to content

Commit 35dd3af

Browse files
committed
Update 04MessageSchema.md
Corrections for #12, example added
1 parent b50f35c commit 35dd3af

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

v1-0-RC4/doc/04MessageSchema.md

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ Composite encoding types are composed of two or more simple types.
177177
| \<type\> attribute | Description | XML type | Usage | Valid values |
178178
|--------------------|----------------------------------------------------------------------------------------------------------------|--------------------|-------------|------------------------------------------------------------------|
179179
| name | Name of encoding | symbolicName\_t | required | Must be unique among all encoding types. |
180+
| offset | The offset from the beginning of the composite. By default, the offset is the sum of preceding element sizes, but it may be increased to effect byte alignment. | unsignedInt | optional | |
180181
| description | Documentation of the type | string | optional | |
181182
| semanticType | Represents a FIX data type | token | optional | Same as field semanticType – see below. |
182183
| sinceVersion | Documents the version of a schema in which a type was added | nonnegativeInteger | default = 0 | Must be less than or equal to the version of the message schema. |
@@ -229,14 +230,16 @@ A composite type often has its elements defined in-line within the `<composite>`
229230
| \<ref\> attribute | Description | XML type | Usage | Valid values |
230231
|--------------------|----------------------------------------------------------------------------------------------------------------|--------------------|-------------|------------------------------------------------------------------|
231232
| name | Usage of the type in this composite | symbolicName\_t | required | |
232-
| type | Name of referenced encoding | symbolicName\_t | required | Must match a defined type, enum or set name attribute. |
233+
| type | Name of referenced encoding | symbolicName\_t | required | Must match a defined type, enum or set or composite name attribute. |
234+
| offset | The offset from the beginning of the composite. By default, the offset is the sum of preceding element sizes, but it may be increased to effect byte alignment. | unsignedInt | optional | |
233235
| sinceVersion | Documents the version of a schema in which a type was added | nonnegativeInteger | default = 0 | Must be less than or equal to the version of the message schema. |
234236
| deprecated | Documents the version of a schema in which a type was deprecated. It should no longer be used in new messages. | nonnegativeInteger | optional | Must be less than or equal to the version of the message schema. |
235237

236-
#### Type reference example
238+
#### Type reference examples
237239

238-
In this example, a futuresPrice is encoded as 64 bit integer mantissa, 8 bit exponent, and a reused enum type. Note that a
239-
reference may carry an offset within the composite encoding that contains it.
240+
**Reference to an enum**
241+
242+
In this example, a futuresPrice is encoded as 64 bit integer mantissa, 8 bit exponent, and a reused enum type.
240243

241244
```xml
242245
<enum name="booleanEnum" encodingType="uint8" semanticType="Boolean">
@@ -247,7 +250,23 @@ reference may carry an offset within the composite encoding that contains it.
247250
<composite name="futuresPrice">
248251
<type name="mantissa" primitiveType="int64" />
249252
<type name="exponent" primitiveType="int8" />
250-
<ref name="isSettlement" type="boolEnum" offset="9" />
253+
<ref name="isSettlement" type="boolEnum" />
254+
</composite>
255+
```
256+
257+
**Reference to a composite type**
258+
259+
In this example, a nested composite is formed by using a reference to another composite type. It supports the expresson of a monetary amount with its currency, such as USD150.45. Note that a reference may carry an offset within the composite encoding that contains it.
260+
261+
```xml
262+
<composite name="price">
263+
<type name="mantissa" primitiveType="int64" />
264+
<type name="exponent" primitiveType="int8" />
265+
</composite>
266+
267+
<composite name="money">
268+
<type name="currencyCode" primitiveType="char" length="3" semanticType="Currency" />
269+
<ref name="amount" type="price" semanticType="Price" offset="3" />
251270
</composite>
252271
```
253272

0 commit comments

Comments
 (0)