... | ... | @@ -104,20 +104,20 @@ A `DataType` structure itself is serializable to (and from) JSON. Here are some |
|
|
The following table shows how an object of dynamic type is represented in the different languages.
|
|
|
Note that all binary numbers are written in *Network Byte Order* (Big-endian/MSB first).
|
|
|
|
|
|
| DataType | Java | JSON | Binary | C++ | Constraint |
|
|
|
| -------- | ---- | ---- | ------ | --- | ---------- |
|
|
|
| `BasicType`: `Q` & `DOUBLE` | `Double` | (floating-point) number | `double` -> 8 bytes | `double` | |
|
|
|
| `BasicType`: `Z` & `INT` | `Integer` | number | `int` -> 4 bytes | `int32_t` | |
|
|
|
| `BasicType`: `N` | `int` | number | `int` -> 4 bytes | `int32_t` | The number must be >= 0. |
|
|
|
| `BasicType`: `N1` | `int` | number | `int` -> 4 bytes | `int32_t` | The number must be **>** 0. |
|
|
|
| `BasicType`: `C` | TODO | Array with 2 numbers | 2 doubles | ? | |
|
|
|
| `BasicType`: `BOOLEAN` | `Boolean` | JSON boolean (`true` or `false`) | 1 byte (`1` or `0`) | `bool` | |
|
|
|
| `BasicType`: `EMPTY` | `null` | nothing? | nothing | nothing | |
|
|
|
| `BasicType`: `VEC2` | [`Vec2` class](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/simulators/commons/-/blob/master/src/main/java/de/rwth/montisim/commons/utils/Vec2.java) | Array with 2 numbers | 2 doubles | ? | |
|
|
|
| `BasicType`: `VEC3` | [`Vec3` class](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/simulators/commons/-/blob/master/src/main/java/de/rwth/montisim/commons/utils/Vec3.java) | Array with 3 numbers | 3 doubles | ? | |
|
|
|
| `VectorType` | An Object array (`Object[]`) with every entry. | JSON Array with every entry. | A short (2 bytes) with the number elements followed by these elements. | ? | |
|
|
|
| `MatrixType` | TODO |
|
|
|
| `EnumType` | TODO |
|
|
|
| `StructType` | TODO |
|
|
|
| `SimplePacketType` | TODO |
|
|
|
| DataType | Java | JSON | Binary | Constraint |
|
|
|
| -------- | ---- | ---- | ------ | ---------- |
|
|
|
| `BasicType`: `Q` & `DOUBLE` | `Double` | (floating-point) number | `double` -> 8 bytes | |
|
|
|
| `BasicType`: `Z` & `INT` | `Integer` | number | `int` -> 4 bytes | |
|
|
|
| `BasicType`: `N` | `int` | number | `int` -> 4 bytes | The number must be >= 0. |
|
|
|
| `BasicType`: `N1` | `int` | number | `int` -> 4 bytes | The number must be **>** 0. |
|
|
|
| `BasicType`: `C` | Vec2 class (temporary) | Array with 2 numbers | 2 doubles | |
|
|
|
| `BasicType`: `BOOLEAN` | `Boolean` | JSON boolean (`true` or `false`) | 1 byte (`1` or `0`) | |
|
|
|
| `BasicType`: `EMPTY` | `null` | nothing? | nothing | |
|
|
|
| `BasicType`: `VEC2` | [`Vec2` class](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/simulators/commons/-/blob/master/src/main/java/de/rwth/montisim/commons/utils/Vec2.java) | Array with 2 numbers | 2 doubles | |
|
|
|
| `BasicType`: `VEC3` | [`Vec3` class](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/simulators/commons/-/blob/master/src/main/java/de/rwth/montisim/commons/utils/Vec3.java) | Array with 3 numbers | 3 doubles | |
|
|
|
| `VectorType` | An Object array (`Object[]`) | JSON Array | A short (2 bytes) with the number elements followed by these elements. | |
|
|
|
| `MatrixType` | A two way Object array (`Object[rows][columns]`) | JSON Array of JSON arrays (row-major) | Row-major storage | (Row-major: rows are contiguous in memory)|
|
|
|
| `EnumType` | `String` with variant name | Variant name | `byte`: index of the variant (TODO implement?) | |
|
|
|
| `StructType` | Object array (`Object[]`) with fields in declaration order | JSON array with fields in declaration order. | Fields in declaration order. | |
|
|
|
| `SimplePacketType` | An Object array with two entries. (`Object[2]`). First entry: `String` of the address. Second: payload. | JSON array with the address string and the payload. | Null-terminated utf-8 string for the address followed by the payload. | |
|
|
|
|