Array APIs

Two sets of APIs are defined to encode the MQeFields arrays. One set of APIs starts with MQeFieldsArrayOf* and the other starts with MQeFields*Array. These two sets of APIs look alike, but the underlying encoding scheme for the elements of the array is different.

MQeFieldsArrayOf*

These APIs treat the entire array as a single block of data, and a single field is used to hold this block. Once this block of data is included in the MQeFieldsArrayOf* APIs, the application program cannot delete or append to the individual elements in the array. These APIs operate on primitives data types, and they are:

MQeFields*Array

This set of APIs encodes each element of the array as a separate field, plus an extra field that holds the array length. In other words, this encoding scheme treats the array as a vector. The benefit of this encoding is that it allows the programmer to modify the individual element and to dynamically adjust the array size.

The encoding for each element in the array to a field consists of the following parts:

Field name
This is created from the concatenation of the field name of the array; a separator character (which is a colon, ":"), and the index of the element. For example, if the field name of the array is foo, then the field name for the first, second, and the nth elements are foo:0, foo:1 and foo:n-1.

Field type
The same type as the array.

Field data
Individual element of the array.

The array length, (the number of elements), is encoded in a separate field and is accessible to the programmer using the MQeFieldsGetArrayLength and MQeFieldsPutArrayLength APIs.

This set of APIs includes the following:



© IBM Corporation 2002. All Rights Reserved