Difference between revisions of "TypeSystems"
Jump to navigation
Jump to search
Line 41: | Line 41: | ||
{| border="1" cellpadding="0" | {| border="1" cellpadding="0" | ||
− | !width="50"|Name||Basic Types Built From | + | !width="50"|Name||Basic Types Built From || Restrictions |
|- | |- | ||
− | |Fixed Length | + | |Fixed Length Byte Array || bytes || length must be equal to constraint |
|- | |- | ||
− | |UUID || Fixed Length Array [16] | + | |UUID || Fixed Length Byte Array [16] || length must be equal to constraint |
|- | |- | ||
− | |URI || Variable Length Array of Strings | + | |URI || Variable Length Array of Strings || must follow URI guidelines in appropriate RFC |
|- | |- | ||
− | |Time | + | |Time || fixed64 || microseconds from 1 Jan 1970 UTC |
|- | |- | ||
− | |Duration | + | |Duration || fixed64 || nanoseconds |
|- | |- | ||
− | |flags (enum where each enumerant can be toggled) | + | |flags (enum where each enumerant can be toggled) || fixed32 or fixed64 depending on the number of enumerants |
|- | |- | ||
− | |Vector3f | + | |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 || |
|- | |- | ||
− | |Vector2d | + | |Vector3d || message consisting of 3 reqiured doubles || |
+ | |- | ||
+ | |Vector2d || message consisting of 2 reqiured floats || | ||
|- | |- | ||
|Quaternion | |Quaternion |
Revision as of 01:43, 14 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 |
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) |