tibrvMsgData_Decoder

Function Type

Declaration

typedef tibrv_status (*tibrvMsgData_Decoder)(
    char**               wire_buffer,
    tibrvMsgField*       field,
    tibrvMsgDataType*    decoded_type);

Purpose

Decode a wire format field to a local datatype.

Remarks

Programs define decoders for custom datatypes. Layer 2 decoder functions augment the Wire Format to C Datatype Conversion Matrix.

Each decoder must fulfill these responsibilities:

Set the size, count and data parts of the destination field struct. (The layer 3 function sets the name, id and type.)
Advance *wire_buffer to the end the source data (in the message). tibrvMsgData_GetBytes() automatically advances this buffer pointer.
Store the low-level type of the new data reference in *decoded_type.
Check consistency, and properly address byte order and endian issues.

Note 

If your decoder implementation allocates process storage, it must call tibrvMsgData_Malloc() rather than malloc.

Parameter

Description

wire_buffer

This parameter receives the location of an address within the wire buffer of the source message. The source data starts at that address.

field

This parameter receives the location of a destination field object. The decoder function must set the parts of this field with the source data, its size and count.

decoded_type

This parameter receives a location. The decoder function must store the low-level type of the new data reference in that location.

See Also

tibrvMsgField

tibrvMsgDataType

tibrvMsgData_GetBytes()