16bit unsigned Integer Data Type
An uint16 data type tests data for being an instance of
python's built-in class int and has a value within 0 and 65535.
If using uint16 data type with allowed values and no conversion defined, check enum data type as a better option.
Features/Limitations
- Validate minimal and maximal data value
- Validate against allowed and not allowed value ranges
- Validate against allowed and not allowed integer values
- Supports Referencing Feature
16bit unsigned Integer Definition Syntax
Table
| Key/Option | Type | Default Value | Restrictions | Description |
|---|---|---|---|---|
| type | str |
'uint16' | ||
| description | str |
Data type description | ||
| default_value | Must match data type's type(s) | Value used to set as default value | ||
| convert_to | str |
Allowed values: - float - str |
||
| minimum | int |
Value must be greater or equal | ||
| maximum | int |
>= 'minimum' | Value must be lower or equal | |
| allowed_ranges | list[dict] |
min length: 1 | Value must be within defined ranges | |
| - start | int |
required | ||
| end | int |
required | ||
| not_allowed_ranges | list[dict] |
Value mustn't be within defined ranges | ||
| - start | int |
required | ||
| end | int |
required | ||
| allowed_values | list |
Data must match one of these values | ||
| - < value > | int |
Must match data type's type(s) | ||
| not_allowed_values | list |
Data mustn't match all of these values | ||
| - < value > | int |
Must match data type's type(s) | ||
| template | str |
must be definded in schema | Merge options from this template | |
| template_merge_options | dict |
Define schema-global template merge instructions | ||
| recursive | bool |
True |
Merge data type definition options in template options recursively. If false, data type defintion options overwrites template options. |
|
| list_merge | str |
append_rp | Allowed values: - append - append_rp - prepend - prepend_rp - replace |
How lists within options data should be merged. |
| reference | dict|str |
|||
| option 1 | str |
Reference keys (implies unique global mode) | ||
| option 2 | dict |
|||
| key | str |
required | ||
| mode | str |
Allowed values: - unique - producer - consumer |
||
| unique_scope | str |
Allowed values: - global - namespace |
||
| producer_scope | str |
Allowed values: - global - namespace |
||
| consumer_scope | str |
Allowed values: - global - namespace |
||
| allow_orphan_producer | bool |
True |
||
| credit | int |
1 (if mode consumer) | min: 0 | |
| references | list[dict|str] |
|||
| - |
dict|str |
|||
| option 1 | str |
Reference keys (implies unique global mode) | ||
| option 2 | dict |
|||
| key | str |
required | ||
| mode | str |
Allowed values: - unique - producer - consumer |
||
| unique_scope | str |
Allowed values: - global - namespace |
||
| producer_scope | str |
Allowed values: - global - namespace |
||
| consumer_scope | str |
Allowed values: - global - namespace |
||
| allow_orphan_producer | bool |
True |
||
| credit | int |
1 (if mode consumer) | min: 0 | |
| doc_value_name | str |
Set value name for documentation |
YAML
type: uint16
description: <str>
default_value: <default_value>
convert_to: <float|str>
maximum: <int>
minimum: <int>
allowed_ranges:
- start: <int>
end: <int>
not_allowed_ranges:
- start: <int>
end: <int>
allowed_values:
- <int>
not_allowed_values:
- <int>
template: <str>
template_merge_options:
recursive: <true|false>
list_merge: <append|append_rp|prepend|prepend_rp|replace>
reference: <reference_definition>
# Multitype!!!
<str>
# or:
key: <str>
mode: <unique|producer|consumer>
unique_scope: <global|namespace>
producer_scope: <global|namespace>
consumer_scope: <global|namespace>
allow_orphan_producer: <true|false>
credits: <int>
references:
- <reference_definition>
# Multitype!!!
<str>
# or
key: <str>
mode: <unique|producer|consumer>
unique_scope: <global|namespace>
producer_scope: <global|namespace>
consumer_scope: <global|namespace>
allow_orphan_producer: <true|false>
credits: <int>
doc_value_name: <str>
Example
type: uint16
description: "Example uint16 definition"
minimum: 1
maximum: 10000
not_allowed_values:
- 1002
- 1003
reference:
key: ref_key
mode: consumer