Get Scalar

Convenience Functions

Declaration

tibrv_status
tibrvMsg_Getscalar_type(
   tibrvMsg       message,
   const char*    fieldName,
   scalar_type*    value);
tibrv_status
tibrvMsg_Getscalar_typeEx(
   tibrvMsg       message,
   const char*    fieldName,
   scalar_type*    value,
   tibrv_u16      fieldId);

Purpose

Get the value of a field as a scalar value.

Remarks

Each convenience function in this family retrieves a field and extracts its data. If the field’s type (as it exists) does not match the type of the convenience function, then the function attempts to convert the data (see Datatype Conversion). If conversion is not possible, the function returns TIBRV_CONVERSION_FAILED.

Function Name

Type

Type Description

tibrvMsg_GetBool

tibrv_bool

boolean

tibrvMsg_GetF32

tibrv_f32

32-bit floating point

tibrvMsg_GetF64

tibrv_f64

64-bit floating point

tibrvMsg_GetI8

tibrv_i8

8-bit integer

tibrvMsg_GetI16

tibrv_i16

16-bit integer

tibrvMsg_GetI32

tibrv_i32

32-bit integer

tibrvMsg_GetI64

tibrv_i64

64-bit integer

tibrvMsg_GetU8

tibrv_u8

8-bit unsigned integer

tibrvMsg_GetU16

tibrv_u16

16-bit unsigned integer

tibrvMsg_GetU32

tibrv_u32

32-bit unsigned integer

tibrvMsg_GetU64

tibrv_u64

64-bit unsigned integer

tibrvMsg_GetIPAddr32

tibrv_ipaddr32

4-byte IP address

tibrvMsg_GetIPPort16

tibrv_ipport16

2-byte IP port

Parameter

Description

message

Get the specified field of this message.

fieldName

Get a field with this name.

value

When extracting a scalar type, the program supplies a location in this parameter, and the function copies the scalar value of the field to that location.

fieldId

Get the field with this identifier. Zero is a special value that signifies no field identifier. All non-zero field identifiers must be unique within each message.

See Also

Validity of Data Extracted From Messages

Field Names and Field Identifiers