Get Scalar

Convenience Methods

Declaration

TibrvStatus getscalar_type(
    const char*          fieldName,
    tibrv_scalar_type&    value,
    tibrv_u16            fieldId=0);

Purpose

Get the value of a field as a scalar value.

Remarks

Each convenience method 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 method, then the method attempts to convert the data (see Datatype Conversion). If conversion is not possible, the method returns TIBRV_CONVERSION_FAILED.

Method Name

Type

Type Description

getBool

tibrv_bool

boolean

getF32

tibrv_f32

32-bit floating point

getF64

tibrv_f64

64-bit floating point

getI8

tibrv_i8

8-bit integer

getI16

tibrv_i16

16-bit integer

getI32

tibrv_i32

32-bit integer

getI64

tibrv_i64

64-bit integer

getU8

tibrv_u8

8-bit unsigned integer

getU16

tibrv_u16

16-bit unsigned integer

getU32

tibrv_u32

32-bit unsigned integer

getU64

tibrv_u64

64-bit unsigned integer

getIPAddr32

tibrv_ipaddr32

4-byte IP address

getIPPort16

tibrv_ipport16

2-byte IP port

Parameter

Description

fieldName

Get a field with this name.

value

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

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 Message Fields

Field Names and Field Identifiers