tibrvMsgData_SetSize()
Function
Declaration
tibrv_statustibrvMsgData_SetSize(
char** buffer,
tibrv_u32 size);
Purpose
Write the size of data into a wire buffer for an encoder.
Remarks
This layer 1 function helps encoders write size information to a message’s wire buffer. It does only part of the work that tibrvMsgData_CopyBytes() does (see tibrvMsgData_SetSize):
Procedure
| 1. | Write the size information into the wire buffer, starting at the position *buffer. |
| 2. | Advance *buffer to point to the end of the size information, which will become the start of the actual data. |
| 3. | Return. |
After tibrvMsgData_SetSize() returns, the encoder can continue by writing the data starting at the (advanced) position *buffer. We recommend using the more complete function tibrvMsgData_CopyBytes() to write the size and data with one call; when finer control is required, programmers can use this function instead, with corresponding responsibility.
When using this function, the encoder must first use tibrvMsgData_ByteSize() to measure the wire size from the data length.
|
Parameter |
Description |
|
|
The encoder supplies the address of a location within the message’s wire buffer. This function writes the |
|
|
Size to copy into the wire buffer. |
Figure 202: tibrvMsgData_SetSize
See Also