The ROS2 side of the Structure DataTypes: a message level as a dataclass.
structure_class makes a dataclass from a name and its fields, and opensmi.server.structures
creates the DataType, its encoding and its definition from that class and encodes its instances.
What is left here is the mapping between the maps a projection works with and those instances, and
the checks a write needs that the encoding does not make.
| Class | |
Two descriptions of one structure name disagree. |
| Function | structure |
Return the dataclass of a name and fields, the same one for equal arguments. |
| Function | structure |
Return the elements of an array a client wrote as maps, or refuse the array as a whole. |
| Function | structure |
Return the instance of a structure that a map of its values describes. |
| Constant | NAME |
Joins the names of the levels above a field in the maps a projection works with. |
| Type Alias | |
A field as its name, its annotation and the length of a fixed-size array (zero otherwise). |
| Function | _inner |
Return the structure class an annotation names, or None, and whether it is a list. |
| Function | _values |
Undocumented |
Return the dataclass of a name and fields, the same one for equal arguments.
The length of a fixed-size array is kept in the field's metadata, for the write check.
Return the elements of an array a client wrote as maps, or refuse the array as a whole.
| Raises | |
ValueError | When the value is not an array of the structure, when a field is null, or when a fixed-size array has the wrong length. The message names the element by its position. |
Return the instance of a structure that a map of its values describes.
| Parameters | |
cls:type | Undocumented |
values:Mapping[ | The values by flat name, the field names of the levels above joined with dots. An array of structures holds one such map per element. |
prefix:str | Undocumented |
| Returns | |
Any | Undocumented |
| Raises | |
KeyError | When a field has no value. |
Joins the names of the levels above a field in the maps a projection works with.
It spells a key, not a BrowseName: the nodes nest.
| Value |
|
A field as its name, its annotation and the length of a fixed-size array (zero otherwise).
The annotation is a ua class, a structure class, or a list of one of them.
| Value |
|