This item represents a simple implementation of a vector (ordered collection). The vector can store only void* data or data of type MQEHANDLE.
If the vector is returned from mqeVector_newFields() or mqeVector_newStrings() and contains MQeFieldsHndl or MQeStringHndl items then upon freeing the vector (with mqeVector_free()) all the contents are removed and freed. This is also the case with vectors returned from most other APIs e.g. mqeFields_fields().
However, if the user invokes mqeVector_new() to instantiate a vector, the system does NOT attempt to manage the memory indicated by the vector pointers - in this case, it is the responsibility of the USER to remove and free the vector elements prior to calling mqeVector_free().
Reference to elements can be made by 'index' This is the position in the (logical) list. Indexes are zero based (-1 < index < size).
Functions | |
MQERETURN | mqeVector_newStrings (MQeExceptBlock *pExceptBlock, MQeVectorHndl *phVector, MQEINT32 initialSize) |
create a new vector to contain elements of type MQeStringHndl. | |
MQERETURN | mqeVector_newFields (MQeExceptBlock *pExceptBlock, MQeVectorHndl *phVector, MQEINT32 initialSize) |
create a new vector to contain elements of type MQeFieldsHndl. | |
MQERETURN | mqeVector_new (MQeExceptBlock *pExceptBlock, MQeVectorHndl *phVector, MQEINT32 initialSize) |
create a new vector. | |
MQERETURN | mqeVector_free (MQeVectorHndl hVector, MQeExceptBlock *pExceptBlock) |
free a vector. | |
MQERETURN | mqeVector_append (MQeVectorHndl hVector, MQeExceptBlock *pExceptBlock, MQEVOID *pObject) |
append an entry to the vector. | |
MQERETURN | mqeVector_insertAt (MQeVectorHndl hVector, MQeExceptBlock *pExceptBlock, MQEVOID *pObject, MQEINT32 insertAt) |
insert an entry into the vector. | |
MQERETURN | mqeVector_removeAt (MQeVectorHndl hVector, MQeExceptBlock *pExceptBlock, MQEVOID **ppObject, MQEINT32 removeAt) |
remove an entry from the vector and return the data pointer at the location. | |
MQERETURN | mqeVector_indexOf (MQeVectorHndl hVector, MQeExceptBlock *pExceptBlock, MQEVOID *pObject, MQeVector_CompareFunc pFunction, MQEINT32 *pIndex) |
find index of entry. | |
MQERETURN | mqeVector_find (MQeVectorHndl hVector, MQeExceptBlock *pExceptBlock, MQEVOID *pFind, MQeVector_CompareFunc pFunction, MQEVOID **ppObject) |
find an entry. This method returns a pointer to the first element in the array that tests equal. | |
MQERETURN | mqeVector_entryAt (MQeVectorHndl hVector, MQeExceptBlock *pExceptBlock, MQEVOID **ppObject, MQEINT32 index) |
find entry at given index. | |
MQERETURN | mqeVector_size (MQeVectorHndl hVector, MQeExceptBlock *pExceptBlock, MQEINT32 *pSize) |
return size of vector. |
|
create a new vector to contain elements of type MQeStringHndl.
|
|
create a new vector to contain elements of type MQeFieldsHndl.
|
|
create a new vector.
|
|
free a vector.
|
|
append an entry to the vector.
|
|
insert an entry into the vector.
|
|
remove an entry from the vector and return the data pointer at the location.
|
|
find index of entry.
|
|
find an entry. This method returns a pointer to the first element in the array that tests equal.
The equality test is the invocation of the supplied function with the user's data (pFind) as the first parameter, and each element in the array as the second parameter. Equality is defined as the return of zero from this function. If the element is not found then the pointer returned is null
|
|
find entry at given index.
If index is out of range then no change is made to the output parameter.
|
|
return size of vector.
|