tibrvMsgData_Converter

Function Type

Declaration

typedef tibrv_status (*tibrvMsgData_Converter)(
    tibrvMsgField*       field,
    tibrv_u8             destination_type,
    tibrvMsgDataType*    converted_type);

Purpose

Convert a message field to another local datatype.

Remarks

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

Each converter function receives a message field, and replaces information within it.

Each converter must fulfill these responsibilities:

For disallowed conversions, return the status code TIBRV_CONVERSION_FAILED.
Convert the field’s data to the destination_type, and store the new data back into the field.
Set the field’s size part to reflect the new size of the converted data.
Set the field’s count part to reflect the new element count of the converted data.
Set the field’s type part to reflect the destination_type.
Store the low-level type of the new reference in *converted_type.

Note 

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

Parameter

Description

field

This parameter receives the location of a message field. The converter function modifies that field to effect the conversion.

destination_type

This parameter receives the type identifier representing the datatype of the resulting field. This parameter instructs the converter function to convert the field to this datatype.

The parameter can be any of the predefined datatypes listed in Wire Format Datatypes, as well as any custom datatypes that the program defines.

converted_type

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

See Also

tibrvMsgField

tibrvMsgDataType

tibrvMsgData_GetBytes()

tibrvMsgData_GetSize()