Skip to content

Value type

eoudejans edited this page Dec 1, 2023 · 34 revisions

A Value Type indicates the kind of values that can be stored in parameters and attributes.

  • A unit determines a set of comparable values (= domain in the terminology of C.J. Date) and must be related to a specific Value Type.
  • A parameter stores one element value, for which the value type is determined by the values unit of the parameter.
  • An attribute is implemented as an array of elements of a specific value type. The value type of these elements is determined by the values unit of the attribute. The location of these elements is implicitly determined by their position in the array. The set of valid locations and the type of these location elements is determined by it's domain unit.

examples of the usage of the value type float32

1. unit<float32>      meter             := baseunit('m', <float32>);
2. parameter<meter>   RealWagonLength   := 22[meter];
3. parameter<float32> MarklinHO         := float32(1.0 / 87.0);
4. parameter<meter>   ScaledWagonLength := MarklinHO * RealWagonLength;

Available value types

Name Description Size MinValue MaxValue Missing
Value
CanBe
DomainUnit
Numeric
Group
Signed
Group
Point
Group
Suffix
bool boolean 1 bit false true n/a X
uint2 unsigned integer 2 bits 0 3 n/a X u2
uint4 unsigned integer 4 bits 0 15 n/a X u4
uint8 unsigned integer 1 byte 0 0xFE (254) 0xFF (255) X X b
uint16 unsigned integer 2 bytes 0 0xFFFE (65534) 0xFFFF (65535) X X w
uint32 unsigned integer 4 bytes 0 0xFFFFFFFE (4294967294) 0xFFFFFFFF (4294967295) X X u
uint64 unsigned long integer 8 bytes 0x0000000
000000000
0xFFFFFFF
FFFFFFFFE
0xFFFFFFF
FFFFFFFFF
X X X u64
int8 signed integer 1 byte 0x81 (-127) 0x7F (127) 0x80 (-128) X X X c
int16 signed integer 2 bytes 0x8001 (-32767) 0x7FFF (32767) 0x8000 (-32768) X X X s
int32 signed integer 4 bytes -2147483647 (0x80000001) 2147483647 (0x7FFFFFFF) -2147483648 (0x80000000)
(-9999 before version 7.126)
X X X i
int64 signed long integer 8 bytes 0x8000000
000000001
0x7FFFFFF
FFFFFFFFF
0x8000000
000000000
X X X i64
float32 floating point 4 bytes -3.4E+38 (7 digits) 3.4E+38 (7 digits) QNaN (-9999.0f before version 7.126) X X f
float64 floating point 8 bytes -1.7E+308 (15 digits) 1.7E+308 (15 digits) QNaN (-9999.0 before version 7.126) X X d
spoint two int16 coördinates (row, col) 4 bytes (MinValue of int16)^2 (MaxValue of int16)^2 (MissingValue of int16)^2 X X
wpoint two uint16 coördinates (row, col) 8 bytes (MinValue of uint16)^2 (MaxValue of uint16)^2 (MissingValue of uint16)^2 X X
ipoint two int32 coördinates (row, col) 8 bytes (MinValue of int32)^2 (MaxValue of int32)^2 (MissingValue of int32)^2 X X
upoint two uint32 coördinates (row, col) 8 bytes (MinValue of uint32)^2 (MaxValue of uint32)^2 (MissingValue of uint32)^2 X X
fpoint two float32 coördinates (x, y) 8 bytes (MinValue of Float32)^2 (MaxValue of Float32)^2 (MissingValue of Float32)^2 X
dpoint two float64 coördinates (x, y) 16 bytes (MinValue of Float64)^2 (MaxValue of Float64)^2 (MissingValue of Float64)^2 X
string sequence of chars 2*sizeof
(UInt32)
+n*sizeof
(uint8)
0x255 0x255 0x255 0x255 'null'

test

Name Description Size Min Value Max Value Missing Value Can Be Domain Unit Numeric Group Signed Group Point Group Suffix
bool boolean 1 bit false true n/a X        
uint2 unsigned integer 2 bits 0 3 n/a X       u2
uint4 unsigned integer 4 bits 0 15 n/a X       u4
uint8 unsigned integer 1 byte 0 0xFE (254) 0xFF (255) X X     b
uint16 unsigned integer 2 bytes 0 0xFFFE (65534) 0xFFFF (65535) X X     w
uint32 unsigned integer 4 bytes 0 0xFFFFFFFE (4294967294) 0xFFFFFFFF (4294967295) X X     u
uint64 unsigned long integer 8 bytes 0x0000000000000000 0xFFFFFFFFFFFFFFFE 0xFFFFFFFFFFFFFFFF X X X   u64
int8 signed integer 1 byte 0x81 (-127) 0x7F (127) 0x80 (-128) X X X   c
int16 signed integer 2 bytes 0x8001 (-32767) 0x7FFF (32767) 0x8000 (-32768) X X X   s
int32 signed integer 4 bytes -2147483647 (0x80000001) 2147483647 (0x7FFFFFFF) -2147483648 (0x80000000)(-9999 before version 7.126) X X X   i
int64 signed long integer 8 bytes 0x8000000000000001 0x7FFFFFFFFFFFFFFF 0x8000000000000000 X X X   i64
float32 floating point 4 bytes -3.4E+38 (7 digits) 3.4E+38 (7 digits) QNaN (-9999.0f before version 7.126)   X X   f
float64 floating point 8 bytes -1.7E+308 (15 digits) 1.7E+308 (15 digits) QNaN (-9999.0 before version 7.126)   X X   d
spoint two int16 coördinates (row, col) 4 bytes (MinValue of int16)^2 (MaxValue of int16)^2 (MissingValue of int16)^2 X     X  
wpoint two uint16 coördinates (row, col) 8 bytes (MinValue of uint16)^2 (MaxValue of uint16)^2 (MissingValue of uint16)^2 X     X  
ipoint two int32 coördinates (row, col) 8 bytes (MinValue of int32)^2 (MaxValue of int32)^2 (MissingValue of int32)^2 X     X  
upoint two uint32 coördinates (row, col) 8 bytes (MinValue of uint32)^2 (MaxValue of uint32)^2 (MissingValue of uint32)^2 X     X  
fpoint two float32 coördinates (x, y) 8 bytes (MinValue of Float32)^2 (MaxValue of Float32)^2 (MissingValue of Float32)^2       X  
dpoint two float64 coördinates (x, y) 16 bytes (MinValue of Float64)^2 (MaxValue of Float64)^2 (MissingValue of Float64)^2       X  
string sequence of chars 2sizeof(UInt32) + nsizeof(uint8)   0x255 0x255 0x255 0x255 'null'        

Clone this wiki locally