Get Nested Message
Convenience Function
Declaration
tibrv_statustibrvMsg_GetMsg
(
tibrvMsg message,
const char* fieldName,
tibrvMsg* subMessage);
tibrv_statustibrvMsg_GetMsgEx
(
tibrvMsg message,
const char* fieldName,
tibrvMsg* subMessage,
tibrv_u16 fieldId);
Purpose
Get the value of a field as a Rendezvous message.
Remarks
Since it is not possible to convert any other datatype to a message, the field must already contain a message. Otherwise, the function returns TIBRV_CONVERSION_FAILED.
Pointer data extracted from the field remain valid until the message is destroyed; that is, even removing the field or updating the field’s value does not invalidate pointer data.
After extracting a submessage, a program can detach it. A detached submessage remains valid and unchanged even after the parent message is destroyed. The program must explicitly destroy the detached submessage.
This function produces values that are modifiable snapshots of the field data. Programs may modify the resulting submessage by adding, removing or updating fields. However, these modifications do not change the field in the original parent message; instead, they force Rendezvous software to make a copy of the field (see Rendezvous Protects the Message from Changes to Submessage Snapshots).
Parameter |
Description |
|
Get the specified field of this message. |
|
Get a field with this name. |
|
The program supplies a location in this parameter, and the function stores a pointer to the submessage in that location. |
|
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