API Reference | developer.brewmp.com API Reference | developer.brewmp.com


API Reference


Brew Release
Brew MP 1.0.2
See Also
- Model Events - ListModelEvent - IVectorModel_InsertAt - IVectorModel Interface
This function deletes an existing item from a vector model, releasing the memory referenced by the item pointer and removing that pointer from the model's array of item pointers.
[in] Pointer to the IVectorModel interface object.
[in] Indicates the zero-based index of the item to be removed from the vector model. The first item in the model is indexed by 0, the second is indexed by 1, and so on. So, if IVectorModel_DeleteAt is called with nIndex equal to 2, item 2 will be removed from the vector model, with items 3, 4, 5, etc all shifting one position lower.
  •    int IVectorModel_DeleteAt(IVectorModel *po, uint32 nIndex);
  •    AEE_SUCCESS   - The model was able to successfully delete the desired item.
       AEE_EBADPARM  - The requested index is not within the range of items stored in the model.
Side Effect
  • Deleting an item in a vector model by calling IVectorModel_DeleteAt() will cause BREW to send an EVT_MDL_LIST_CHANGE ListModelEvent to any object that has registered as a listener with the model.
    The fields of the ListModelEvent will contain the following information:
           pos:      The index of the item that has been deleted from the vector model
           oldSize:  The number of items in the vector model before calling IVectorModel_DeleteAt().
           newSize:  The number of items in the vector model after calling IVectorModel_DeleteAt().
Following a successful call to IVectorModel_DeleteAt(), the number of items in the model is reduced by one. The array of item pointers in the vector model is also reduced by one pointer, with the 'nIndex' pointer being removed and all pointers above being moved down by one position. The vector model may define a custom free memory routine to release the memory consumed by complex items. The custom free memory routine is registered with the vector model by calling IVectorModel_SetPfnFree().