Difference between revisions of "TypeSystems"

From Sirikata Wiki
Jump to navigation Jump to search
(Added SHA256 type)
Line 46: Line 46:
 
|-
 
|-
 
|UUID || Fixed Length Byte Array [16] || length must be equal to constraint
 
|UUID || Fixed Length Byte Array [16] || length must be equal to constraint
 +
|-
 +
|SHA256 || Fixed Length Byte Array [32] || length must be equal to constraint (should this changed to a generic Hash type?)
 
|-
 
|-
 
|URI || Variable Length Array of Strings || must follow URI guidelines in appropriate RFC
 
|URI || Variable Length Array of Strings || must follow URI guidelines in appropriate RFC

Revision as of 01:16, 21 February 2009

We want the type system to be serialization agnostic so we can support different backends.

Our current implementation ideas revolve around starting from the serialization format specified in protocol buffers. This gives us the following types

Name
double
float
int32
int64
uint32
uint64
sint32
sint64
fixed32
fixed64
sfixed32
sfixed64
bool
string
bytes

There are some additional types that would be nice to add:

Name Basic Types Built From Restrictions
Fixed Length Byte Array bytes length must be equal to constraint
UUID Fixed Length Byte Array [16] length must be equal to constraint
SHA256 Fixed Length Byte Array [32] length must be equal to constraint (should this changed to a generic Hash type?)
URI Variable Length Array of Strings must follow URI guidelines in appropriate RFC
Time fixed64 microseconds from 1 Jan 1970 UTC
Duration fixed64 nanoseconds
flags (enum where each enumerant can be toggled) fixed32 or fixed64 depending on the number of enumerants
Vector3f message consisting of 3 reqiured floats
Normal3f message consisting of 3 reqiured floats sum of squares must be nearly 1
Vector2f message consisting of 2 reqiured floats
Vector3d message consisting of 3 reqiured doubles
Vector2d message consisting of 2 reqiured floats
Quaternion
Angle (0-2pi)
Bounding box/sphere (NULL defined)