Types » History » Version 12

Version 11 (J. Moringen, 06/17/2011 09:02 PM) → Version 12/13 (J. Moringen, 08/30/2011 03:09 AM)

h1. Types

h2. Introduction

RSB is concerned with two kinds of types:
# [[Glossary|Wire-schemas]] which describe data being exchanged through transport mechanisms
# [[Glossary|Data-types]] which are restricted to individual clients, depend on the respective programming languages and describe domain objects before they get passed to RSB or after they have been obtained from RSB

The following section specifies the mapping between wire-schemas and data-types for a set of fundamental types and a generic mechanism for arbitrary user-supplied domain-objects.

h2. Wire Schema <-> Programming Language Types Mapping

This section documents the mapping between wire schemas, designators of which are included in RSB's notifications, and corresponding programming language types. The values that are actually contained in notifications are called "String Designators" of wire schemas here.

h3. Fundamental Types

For "fundamental" types, the mapping is based on "the type mapping used by Google's protocol buffers":http://code.google.com/apis/protocolbuffers/docs/proto.html#scalar.

|_.Wire Schema |_.String Designator |_.C++ |_.Python |_.Java |_.Common Lisp |
| No value | "void" | void | None | null | nil |
|
Double precision float | "double" | double | | double | double-float |
| Single precision float | "float" | float | float | float | single-float |
| 32 bit signed integer | "int32" | int32 | | int | (signed-byte 32) |
| 64 bit signed integer | "int64" | int64 | | long | (signed-byte 64) |
| 32 bit unsigned integer | "uint32" | uint32 | | int | (unsigned-byte 32) |
| 64 bit unsigned integer | "uint64" | uint64 | | long | (unsigned-byte 64) |
| bool | "bool" | bool | bool | boolean | boolean |
| ASCII string | "ascii-string" | string | str | String | string |
| UTF-8 string | "utf-8-string" | string | unicode | String | string |
| Sequence of Bytes | "bytes" | string | | ByteString | (simple-array (unsigned-byte 8) (*)) |

_Note: In C++, support for the ASCII string and UTF-8 string schemas is limited in the following ways:_
* When decoding data in either schema, invalid strings will be accepted without signaling an error
* In both schemas, string values are represented as @std::string@ objects which known nothing about the respective encodings
** In particular, UTF-8 multi-byte sequences appear as multiple @char@ s

h3. Structured Data

* GBP for notification serialization (not exposed to user)
* A single serialization mechanism is applied for every transport in a single system
* No composite support at this level
* TODO Extend converter selection with wildcard mechnism to ease introspection and implementation of generic converters