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: aliases/aliases.adoc
+10-11Lines changed: 10 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,11 +18,11 @@ For example let's assume there is some message definition like the one below:
18
18
<intname="SomeField"type="uint32" />
19
19
...
20
20
</message>
21
-
</schema>
21
+
</schema>
22
22
----
23
23
In case there is a need to rename the **SomeField** name to be **SomeOtherField**,
24
24
then the message definition can add an **<alias>** with the old name to
25
-
the renamed field in order to keep the old client code compiling.
25
+
the renamed field in order to keep the old client code compiling.
26
26
[source,xml]
27
27
----
28
28
<?xmlversion="1.0"encoding="UTF-8"?>
@@ -34,7 +34,7 @@ the renamed field in order to keep the old client code compiling.
34
34
</fields>
35
35
<aliasname="SomeField"field="$SomeOtherField" />
36
36
</message>
37
-
</schema>
37
+
</schema>
38
38
----
39
39
In such case the code generator must allow access of the renamed field by
40
40
both old and new names.
@@ -63,7 +63,7 @@ there was an enum field with limited number of valid values:
63
63
</enum>
64
64
...
65
65
</message>
66
-
</schema>
66
+
</schema>
67
67
----
68
68
When need arises to introduce new value the developer may decide to save I/O
69
69
traffic reuse the same byte occupied by the `SomeEnum` field, like below.
@@ -82,10 +82,10 @@ traffic reuse the same byte occupied by the `SomeEnum` field, like below.
82
82
</bitfield>
83
83
...
84
84
</message>
85
-
</schema>
85
+
</schema>
86
86
----
87
87
In order to keep old client code compiling it is possible to introduce
88
-
alias to the `SomeEnum` member of the <<fields-bitfield, <bitfield> >>
88
+
alias to the `SomeEnum` member of the <<fields-bitfield, <bitfield> >>
89
89
like this:
90
90
[source,xml]
91
91
----
@@ -103,15 +103,15 @@ like this:
103
103
</fields>
104
104
<aliasname="SomeEnum"field="$F1.SomeEnum" />
105
105
</message>
106
-
</schema>
106
+
</schema>
107
107
----
108
108
There can be any number of different **<alias>** nodes. The elements
109
109
that are allowed to have **<alias>**-es are <<messages-messages, <message> >>,
110
110
<<interfaces-interfaces, <interface> >>, and <<fields-bundle, <bundle> >>.
111
111
112
112
[[aliases-description]]
113
113
=== Description ===
114
-
The **<alias>** node may also have **description**
114
+
The **<alias>** node may also have **description**
115
115
<<intro-properties, property>> which is expected to find its way into
116
116
the generated code as a comment for the relevant access functions.
117
117
[source,xml]
@@ -160,7 +160,7 @@ When a new <<messages-messages, <message> >> or <<interfaces-interfaces, &
160
160
copy all the fields from other already defined <<messages-messages, <message> >>, <<interfaces-interfaces, <interface> >>, or <<fields-bundle, <bundle> >>
|Property Name|Allowed Type / Value|DSL Version|Required|Default Value ^.^|Description
11
11
|**checksumFrom**|<<intro-names, name>> string|5|no (unless **semanticLayerType** is "checksum" and **checksumUntil** is empty)||Name of the frame layer, from which the checksum calculation starts. Applicable only when `semanticLayerType="checksum"`.
12
12
|**checksumUntil**|<<intro-names, name>> string|5|no (unless **semanticLayerType** is "checksum" and **checksumFrom** is empty)||Name of the frame layer, until (and including) which the checksum calculation is executed. Applicable only when `semanticLayerType="checksum"`.
13
-
|**[.line-through]#idReplacement#**|<<intro-boolean, bool>>|1|no|false|Mark the layer as one replacing <<frames-id, <id> >>. +
13
+
|**[.line-through]#idReplacement#**|<<intro-boolean, bool>>|1|no|false|Mark the layer as one replacing <<frames-id, <id> >>. +
14
14
**Deprecated**, use `semanticLayerType="id"` instead.
15
15
|**semanticLayerType**|"payload", "id", "size", "sync", "checksum", "value", "custom"|5|no|custom|Specify what other layer **<custom>** one is replacing.
@@ -29,7 +29,7 @@ Applicable only to members of the <<messages-messages, <message> >> or <<f
29
29
|**reuse**|<<intro-references, reference>> string|1|no||Field, definition of which to copy.
30
30
|**reuseCode**|<<intro-boolean, bool>>|5|no|false|In case of **reuse** apply **copyCodeFrom** with the same <<intro-references, reference>> string.
31
31
|**semanticType**|"none", "messageId", "version", "length"|1|no|none|Specify semantic type of the field. It allows code generator to generate special code for special cases. Value "length" was introduced in **v2** of this specification.
32
-
|**sinceVersion**|<<intro-numeric, unsigned>>|1|no|0|Version of the protocol in which field was introduced. +
32
+
|**sinceVersion**|<<intro-numeric, unsigned>>|1|no|0|Version of the protocol in which field was introduced. +
33
33
Applicable only to members of the <<messages-messages, <message> >> or <<fields-bundle, <bundle> >>.
34
34
|**validateMinLength**|<<intro-numeric, numeric>>|7|no||Specify expected minimal serialization length of the field.
35
35
|**validOverride**|"any", "replace", "extend", "none"|4|no|any|Control the overriding code for **valid** retrieval.
0 commit comments