Wire Format Datatypes

Wire Format Type

Type Description

Notes

Special Types

TIBRVMSG_MSG

Rendezvous message

 

TIBRVMSG_DATETIME

Rendezvous datetime

 

TIBRVMSG_OPAQUE

opaque byte sequence

 

TIBRVMSG_STRING

ISO 8859-1 character string (also called Latin-1)

NULL-terminated.

TIBRVMSG_XML

XML data (byte sequence)

 
Scalar Types

TIBRVMSG_BOOL

boolean

TIBRV_FALSE, TIBRV_TRUE

TIBRVMSG_I8

8-bit integer

 

TIBRVMSG_I16

16-bit integer

 

TIBRVMSG_I32

32-bit integer

 

TIBRVMSG_I64

64-bit integer

 

TIBRVMSG_U8

8-bit unsigned integer

 

TIBRVMSG_U16

16-bit unsigned integer

 

TIBRVMSG_U32

32-bit unsigned integer

 

TIBRVMSG_U64

64-bit unsigned integer

 

TIBRVMSG_F32

32-bit floating point

 

TIBRVMSG_F64

64-bit floating point

 

TIBRVMSG_IPADDR32

4-byte IP address

Network byte order.

String representation is four-part dot-delimited notation.

TIBRVMSG_IPPORT16

2-byte IP port

Network byte order.

String representation is a 16-bit decimal integer.

Array Types

TIBRVMSG_I8ARRAY

8-bit integer array

The count property of the field reflects the number of elements in the array.

TIBRVMSG_I16ARRAY

16-bit integer array

TIBRVMSG_I32ARRAY

32-bit integer array

TIBRVMSG_I64ARRAY

64-bit integer array

TIBRVMSG_U8ARRAY

8-bit unsigned integer array

TIBRVMSG_U16ARRAY

16-bit unsigned integer array

TIBRVMSG_U32ARRAY

32-bit unsigned integer array

TIBRVMSG_U64ARRAY

64-bit unsigned integer array

TIBRVMSG_F32ARRAY

32-bit floating point array

TIBRVMSG_F64ARRAY

64-bit floating point array

C Datatypes

C Type

Type Description

Notes

tibrv_bool

boolean

TIBRV_FALSE, TIBRV_TRUE

tibrv_f32

32-bit floating point

 

tibrv_f64

64-bit floating point

 

tibrv_i8

8-bit integer

 

tibrv_i16

16-bit integer

 

tibrv_i32

32-bit integer

 

tibrv_i64

64-bit integer

 

tibrv_u8

8-bit unsigned integer

 

tibrv_u16

16-bit unsigned integer

 

tibrv_u32

32-bit unsigned integer

 

tibrv_u64

64-bit unsigned integer

 

tibrv_ipaddr32

4-byte IP address

Stored in network byte order.

String representation is four-part dot-delimited notation.

tibrv_ipport16

2-byte IP port

Stored in network byte order.

String representation is a decimal integer (all 16-bits).

tibrvMsgDateTime

Rendezvous datetime struct

See TibrvMsgDateTime.

See also tibrvMsgDateTime.

tibrv_f32*

32-bit floating point array

 

tibrv_f64*

64-bit floating point array

 

tibrv_i8*

8-bit integer array

 

tibrv_i16*

16-bit integer array

 

tibrv_i32*

32-bit integer array

 

tibrv_i64*

64-bit integer array

 

tibrv_u8*

8-bit unsigned integer array

 

tibrv_u16*

16-bit unsigned integer array

 

tibrv_u32*

32-bit unsigned integer array

 

tibrv_u64*

64-bit unsigned integer array

 

tibrvMsg

Rendezvous message

See TibrvMsg.

See also tibrvMsg.

char*

character string

ISO 8859-1 (Latin-1) character encoding

void*

opaque byte sequence

 

Datatype Conversion

Rendezvous software converts datatypes in two situations:

As it translates a message to wire format (when sending a message).
As it extracts data from a message field.

Convenience methods that extract a field from a Rendezvous message automatically decode the field’s data to a homologous C type. Figure 14 specifies the homologous decodings as well as conversions to other types. See also, TibrvMsg::getField()TibrvMsg::getField().

Convenience methods that add a field to a Rendezvous message or update an existing field severely restrict type encoding. These methods encode only to homologous types (the solid dots along the diagonal of Wire Format to C Datatype Conversion Matrix indicate pairs of homologous types).

General Rules

These general rules govern most conversions.

Supported

All wire format types decode to the homologous C datatypes (in get calls), and all C datatypes encode to the homologous wire format types (in add and update calls).
All wire format numeric scalar types convert to all C numeric scalar types.
All wire format numeric array types convert to all C numeric array types.

Caution

Converting a wire format opaque or XML byte sequence to a C character string creates a printable string, but the string does not capture any of the opaque data bytes (it captures only the number of bytes).
Converting a wire format signed integer to a C unsigned integer discards the sign.
Converting a wire format numeric type to a C numeric type with fewer bits risks loss of precision.
Converting wire format floating point numbers to C integer types discards the fractional part.
Converting large (out-of-range) wire format floating point numbers to C integers results in the maximum integer of the C target size.

Not Supported

Array types do not convert to scalar types.
Scalar types do not convert to array types.
C types do not convert to non-homologous wire format types (when adding or updating a field).

Converting to Boolean

When converting a string to a boolean, all strings in which the first character is either t or T map to boolean true. All other strings map to boolean false.
When converting a numeric value to a boolean, zero maps to boolean false. All non-zero numeric values map to boolean true.

Figure 230: Wire Format to C Datatype Conversion Matrix