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


API Reference


Brew Release
Brew MP 1.0.2
See Also
Model Events ListModelEvent IArrayModel Interface IArrayModel_GetAt()
This function sets an array model to point to a new set of items. The caller is expected to manage the memory occupied by the referenced items, with the array model only having visibility to the number of items, the fixed size of each item, and a count of the number of items stored in the array.
Pointer to the IArrayModel interface object.
Pointer to the items to be represented by the array model, or NULL if there are no items stored in the array. The memory occupied by the array of item pointers is managed by the array model, while the memory occupied by the items themselves would be managed by a customized memory freeing callback.
Indicates the number if items stored in the array, or zero if the array is empty.
The size, in bytes, of each array item. Each item in an array model occupies a fixed and equal amount of memory.
  •    void IArrayModel_SetItems(IArrayModel *po, void *pItems, uint32 nItems, uint16 nItemSize); 
  • None
Side Effect
  • Changing the items stored in an array model by calling IArrayModel_SetItems() 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:      0 
           oldSize:  The number of items in the array model before calling IArrayModel_SetItems().
           newSize:  The number of items in the array model after calling IArrayModel_SetItems().
IArrayModel_SetItems() operates on a full array of items; it cannot be used to set the contents of individual array items.