You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: v2-0-RC1/doc/02FieldEncoding.md
+5-13Lines changed: 5 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,18 +11,17 @@ and message schema but are introduced here as an overview.
11
11
12
12
### Semantic data type
13
13
14
-
The FIX semantic data type of a field tells a data domain in a broad
15
-
sense, for example, whether it is numeric or character data, or whether
16
-
it represents a time or price. Simple Binary Encoding represents all of
14
+
The FIX semantic data type of a field tells a data domain interpreted at the application layer, for example, whether it is numeric or character data, or whether it represents a time or price. Simple Binary Encoding represents all of
17
15
the semantic data types that FIX protocol has defined across all
18
16
encodings. In message specifications, FIX data type is declared with
19
17
attribute semanticType. See the section 2.2 below for a listing of those
20
18
FIX types.
21
19
22
20
### Encoding
23
21
24
-
Encoding tells how a field of a specific data type is encoded on the
25
-
wire. An encoding maps a FIX data type to either a simple, primitive
22
+
Encoding tells how a data element is encoded on the wire. Encoding belongs strictly to the presentation layer. It is context-free and carries no business semantics.
23
+
24
+
An encoding maps a FIX data type to either a simple, primitive
26
25
data type, such as a 32 bit signed integer, or to a composite type. A
27
26
composite type is composed of two or more simple primitive types. For
28
27
example, the FIX data type Price is encoded as a decimal, a composite
@@ -142,17 +141,10 @@ Attributes are optional unless specified otherwise.
142
141
| maxValue | The highest valid value of a range (inclusive unless specified otherwise). Applies to scalar data types, but not to String or data types. |
143
142
| semanticType | Tells the FIX semantic type of a field or encoding. It may be specified on either a field or its encoding. |
144
143
145
-
### Inherited attributes
146
-
147
-
The attributes listed above apply to a field element or its encoding
148
-
(wire format). Any attributes specified on an encoding are inherited by
149
-
fields that use that encoding.
150
-
151
144
### Non-FIX types
152
145
153
146
Encodings may be added to SBE messages that do not correspond to listed
154
-
FIX data types. In that case, the encoding and fields that use the
155
-
encoding will not have a semanticType attribute.
147
+
FIX data types. In that case, the fields that use the encoding will not have a semanticType attribute.
| name | Name of encoding | symbolicName\_t | required | Must be unique among all encoding types in a schema. |
141
141
| description | Documentation of the type | string | optional ||
142
-
| presence | Presence of any field encoded with this type | token || required optional constant |
143
-
| nullValue | Override of special value used to indicate null for an optional field | string | Only valid if presence = optional | The XML string must be convertible to the scalar data type specified by primitiveType. |
144
-
| minValue | Lowest acceptable value | string |||
145
-
| maxValue | Highest acceptable value | string |||
142
+
| presence | Presence of this element within a composite type | token || required optional constant |
146
143
| length | Number of elements of the primitive data type | nonnegativeInteger | default = 1 | Value “0” represents variable length. |
147
144
| 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 |
148
145
| primitiveType | The primitive data type that backs the encoding | token | required | char int8 int16 int32 int64 uint8 uint16 uint32 uint64 float double |
149
146
| semanticType | Represents a FIX data type | token | optional | Same as field semanticType – see below. |
150
147
| 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. |
151
148
| 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. |
152
149
153
-
#### FIX data type specification
154
-
155
-
The attribute `semanticType` must be specified on either a field or on its
156
-
corresponding type encoding. It need not be specified in both places,
@@ -179,7 +166,6 @@ Composite encoding types are composed of two or more simple types.
179
166
| name | Name of encoding | symbolicName\_t | required | Must be unique among all encoding types. |
180
167
| 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 ||
181
168
| description | Documentation of the type | string | optional ||
182
-
| semanticType | Represents a FIX data type | token | optional | Same as field semanticType – see below. |
183
169
| 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. |
184
170
| 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. |
185
171
@@ -197,7 +183,7 @@ In this example, a Price is encoded as 32 bit integer mantissa and a
197
183
constant exponent, which is not sent on the wire.
198
184
199
185
```xml
200
-
<compositename="decimal32"semanticType="Price">
186
+
<compositename="decimal32">
201
187
<typename="mantissa"primitiveType="int32" />
202
188
<typename="exponent"primitiveType="int8"
203
189
presence="constant">-4</type>
@@ -242,7 +228,7 @@ A composite type often has its elements defined in-line within the `<composite>`
242
228
In this example, a futuresPrice is encoded as 64 bit integer mantissa, 8 bit exponent, and a reused enum type.
0 commit comments