From 67db0eff707070237eb279078c4d5c93f520812b Mon Sep 17 00:00:00 2001 From: Don Mendelson Date: Mon, 14 Dec 2015 12:40:13 -0600 Subject: [PATCH 1/5] Offsets within composite types #11 Created new attributeGroup "positionAttributes" and applied it to all encoding types and fields. --- v1-0-RC4/resources/SimpleBinary1-0.xsd | 29 +++++++++++++------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/v1-0-RC4/resources/SimpleBinary1-0.xsd b/v1-0-RC4/resources/SimpleBinary1-0.xsd index 6120d4a..5bd4c74 100644 --- a/v1-0-RC4/resources/SimpleBinary1-0.xsd +++ b/v1-0-RC4/resources/SimpleBinary1-0.xsd @@ -171,13 +171,6 @@ - - - Offset from start of a composite type as a - zero-based index. - - - @@ -197,6 +190,7 @@ + @@ -217,6 +211,7 @@ + @@ -234,6 +229,7 @@ + @@ -282,6 +278,7 @@ + @@ -302,13 +299,6 @@ - - - Offset from start of a block as a zero-based - index. - - - @@ -317,6 +307,7 @@ + @@ -359,6 +350,16 @@ + + + + Offset from start of a composite type or block + as a zero-based index. + + + + + From c914e267fedc186b677f48c5b019fe0790c48c5f Mon Sep 17 00:00:00 2001 From: Don Mendelson Date: Mon, 14 Dec 2015 16:05:50 -0600 Subject: [PATCH 2/5] Composites reusing other types #12 (Depends on offset attribute added for #11.) --- v1-0-RC4/resources/SimpleBinary1-0.xsd | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/v1-0-RC4/resources/SimpleBinary1-0.xsd b/v1-0-RC4/resources/SimpleBinary1-0.xsd index 5bd4c74..701c847 100644 --- a/v1-0-RC4/resources/SimpleBinary1-0.xsd +++ b/v1-0-RC4/resources/SimpleBinary1-0.xsd @@ -209,6 +209,7 @@ + @@ -250,6 +251,19 @@ + + + + A reference to any existing encoding type (simple type, enum or set) + to reuse as a member of a composite type + + + + + + + + @@ -262,6 +276,7 @@ + From 39fb8e83e06ee942addb2a4e0a20db3727766f49 Mon Sep 17 00:00:00 2001 From: Don Mendelson Date: Mon, 21 Dec 2015 10:26:02 -0600 Subject: [PATCH 3/5] Change name "positionAttributes" to "alignmentAttributes". --- v1-0-RC4/resources/SimpleBinary1-0.xsd | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/v1-0-RC4/resources/SimpleBinary1-0.xsd b/v1-0-RC4/resources/SimpleBinary1-0.xsd index 701c847..4fd53bb 100644 --- a/v1-0-RC4/resources/SimpleBinary1-0.xsd +++ b/v1-0-RC4/resources/SimpleBinary1-0.xsd @@ -190,7 +190,7 @@ - + @@ -212,7 +212,7 @@ - + @@ -230,7 +230,7 @@ - + @@ -260,7 +260,7 @@ - + @@ -276,7 +276,7 @@ - + @@ -293,7 +293,6 @@ - @@ -322,7 +321,7 @@ - + @@ -365,7 +364,7 @@ - + Offset from start of a composite type or block From 09689853426097941493be8183756bbcf1a95521 Mon Sep 17 00:00:00 2001 From: Don Mendelson Date: Mon, 21 Dec 2015 10:32:57 -0600 Subject: [PATCH 4/5] #11 offset within composite Offset attribute applies to a simple type, enum or bitset within a composite type. --- v1-0-RC4/doc/04MessageSchema.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/v1-0-RC4/doc/04MessageSchema.md b/v1-0-RC4/doc/04MessageSchema.md index 8fc1597..9c0f0f8 100644 --- a/v1-0-RC4/doc/04MessageSchema.md +++ b/v1-0-RC4/doc/04MessageSchema.md @@ -208,7 +208,7 @@ constant exponent, which is not sent on the wire. If a message designer wishes to control byte boundary alignment or map to an existing data structure, element offset may optionally be -specified on simple types within a composite type. Offset is the number +specified on a simple type, enum or bitset within a composite type. Offset is the number of octets from the start of the composite; it is a zero-based index. If specified, offset must be greater than or equal to the sum of the @@ -558,4 +558,4 @@ Reserved element names | unit | timestamp, TZ time | | version | messageHeader | | week | MonthYear | -| year | MonthYear | \ No newline at end of file +| year | MonthYear | From f0c92a761387298e9b4b600859eb7aac99b2e5e3 Mon Sep 17 00:00:00 2001 From: Don Mendelson Date: Mon, 21 Dec 2015 11:28:06 -0600 Subject: [PATCH 5/5] Update 04MessageSchema.md --- v1-0-RC4/doc/04MessageSchema.md | 43 ++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/v1-0-RC4/doc/04MessageSchema.md b/v1-0-RC4/doc/04MessageSchema.md index 9c0f0f8..bb07dcb 100644 --- a/v1-0-RC4/doc/04MessageSchema.md +++ b/v1-0-RC4/doc/04MessageSchema.md @@ -58,7 +58,7 @@ their encodings. | id | Unique identifier of a schema | unsignedInt | | Should be unique between counterparties | | version | Version of this schema | nonnegativeInteger | | Initial version is zero and is incremented for each version | | semanticVersion | Version of FIX semantics | string | optional | FIX versions, such as “FIX.5.0\_SP2” | -| byteOrder | Byte order of encoding | token | default = littleEndian | littleEndian bigEndian | +| byteOrder | Byte order of encoding | token | default = littleEndian | littleEndian bigEndian | | description | Documentation of the schema | string | optional | | | headerType | Name of the encoding type of the message header, which is the same for all messages in a schema. | string | default= messageHeader | An encoding with this name must be contained by \. | @@ -145,8 +145,7 @@ The element value represents a constant if attribute | maxValue | Highest acceptable value | string | | | | length | Number of elements of the primitive data type | nonnegativeInteger | default = 1 | Value “0” represents variable length. | | offset | If a member of a composite type, tells 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 | See section 4.4.4.3 below | -| primitiveType | The primitive data type that backs the encoding | token | required | char int8 int16 int32 int64 uint8 uint16 uint32 uint64 float double -| +| primitiveType | The primitive data type that backs the encoding | token | required | char int8 int16 int32 int64 uint8 uint16 uint32 uint64 float double | | semanticType | Represents a FIX data type | token | optional | Same as field semanticType – see below. | | 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. | | 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. | @@ -221,6 +220,37 @@ For a composite type, nullness is indicated by the value of its first element. For example, if a price field is optional, a null value in its mantissa element indicates that the price is null. +### Reference to reusable types + +A composite type often has its elements defined in-line within the `` XML element as shown in the example above. Alternatively, a common type may be defined once on its own, and then referred to by name with the composite type using a `` element. + +#### `` attributes + +| \ attribute | Description | XML type | Usage | Valid values | +|--------------------|----------------------------------------------------------------------------------------------------------------|--------------------|-------------|------------------------------------------------------------------| +| name | Usage of the type in this composite | symbolicName\_t | required | | +| type | Name of referenced encoding | symbolicName\_t | required | Must match a defined type, enum or set name attribute. | +| 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. | +| 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. | + +#### Type reference example + +In this example, a futuresPrice is encoded as 64 bit integer mantissa, 8 bit exponent, and a reused enum type. Note that a +reference may carry an offset within the composite encoding that contains it. + +```xml + + 0 + 1 + + + + + + + +``` + ### Enumeration encodings An enumeration explicitly lists the valid values of a data domain. Any @@ -238,10 +268,10 @@ The encoding of an enumeration may be char or any unsigned integer type. |--------------------|----------------------------------------------------------------------------------------------------------------|--------------------|-------------|-----------------------------------------------------------------------------------| | name | Name of encoding | symbolicName\_t | required | Must be unique among all encoding types. | | description | Documentation of the type | string | optional | | -| encodingType | Name of a simple encoding type | symbolicName\_t | required | Must match the name attribute of a scalar \ element *or* a primitive type: char uint8 uint16 uint32 uint64 - | 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. | +| encodingType | Name of a simple encoding type | symbolicName\_t | required | Must match the name attribute of a scalar \ element *or* a primitive type: char uint8 uint16 uint32 uint64 | +| 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. | | 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. | - +| offset | If a member of a composite type, tells 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 | #### `` element attributes @@ -300,6 +330,7 @@ The encoding of a bitset should be an unsigned integer type. | encodingType | Name of a simple encoding type | string | required | Must match the name attribute of a scalar \ element *or* a primitive type: uint8 uint16 uint32 uint64 | | 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. | | 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. +| offset | If a member of a composite type, tells 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 | #### `` element attributes