... | @@ -10,21 +10,19 @@ It can be set to any of its child classes: |
... | @@ -10,21 +10,19 @@ It can be set to any of its child classes: |
|
- `BasicType`: Contains a enum that can be set to the following types: `Q`, `Z`, `N`, `N1`, `C`, `BOOLEAN`, `DOUBLE` (=`Q`), `INT` (=`Z`), `EMPTY`, `VEC2` or `VEC3`.
|
|
- `BasicType`: Contains a enum that can be set to the following types: `Q`, `Z`, `N`, `N1`, `C`, `BOOLEAN`, `DOUBLE` (=`Q`), `INT` (=`Z`), `EMPTY`, `VEC2` or `VEC3`.
|
|
- `VectorType`: An array of any `DataType`.
|
|
- `VectorType`: An array of any `DataType`.
|
|
- `MatrixType`: A 2D matrix of any `DataType`.
|
|
- `MatrixType`: A 2D matrix of any `DataType`.
|
|
- `EnumType`: List the name of the enum variants of an enumeration.
|
|
- `EnumType`: Lists the name of the enum variants of an enumeration.
|
|
- `StructType`: Specifies the name of the struct as well as the name and `DataType` of its fields.
|
|
- `StructType`: Specifies the name of the struct as well as the name and `DataType` of its fields.
|
|
- `SimplePacketType`: A special data-type used to represent a simple network packet.
|
|
- `SimplePacketType`: A special data-type used to represent a *simple network* packet.
|
|
|
|
|
|
## Usage
|
|
## Usage
|
|
|
|
|
|
Using the `DataType` system allows to do the following:
|
|
Using the `DataType` system allows to do the following:
|
|
|
|
|
|
- Compare `DataTypes` for equality.
|
|
- Compare `DataTypes` for equality (for example when validating the EE-setup).
|
|
- Serialize an object of dynamic type to (and from) **JSON** (`toJson()` and `fromJson()` methods).
|
|
- Serialize an object of dynamic type to (and from) **JSON** (`toJson()` and `fromJson()` methods).
|
|
- Serialize an object of dynamic type to (and from) **binary** (`toBinary()` and `fromBinary()` methods).
|
|
- Serialize an object of dynamic type to (and from) **binary** (`toBinary()` and `fromBinary()` methods).
|
|
- Print an object of dynamic type in a readable way (`toString(Object)` method).
|
|
- Print an object of dynamic type in a readable way (`toString(Object)` method).
|
|
|
|
|
|
TODO make c++ code for data types available.
|
|
|
|
|
|
|
|
## JSON examples
|
|
## JSON examples
|
|
|
|
|
|
A `DataType` structure itself is serializable to (and from) JSON. Here are some examples for every `DataType`.
|
|
A `DataType` structure itself is serializable to (and from) JSON. Here are some examples for every `DataType`.
|
... | | ... | |