Developer

API Reference

ITypedValueModel_AdaptGet()

Brew Release
Brew MP 1.0.2
See Also
- PFNTADAPTGET
- ITypedValueModel_GetValue()
Description
This function sets up the callback function and private data to be used by the value model when retrieving data from the model via ITypedValueModel_GetValue(). Models that store arbitrarily complex data may use a callback (defined by PFNTADAPTGET) to retrieve specific portions of the model's data. For example, a value model that stores information to be displayed in a list -- say, an icon, some text, plus some indication of the text style -- could specify an adaptive get callback routine that could return just the text, or just the icon -- apart from the entire data structure.
Parameters
  • pif
    []:
    Pointer to the ITypedValueModel interface object.
  • pfn
    []:
    Pointer to the callback function that the model will call to retrieve the data stored in a value model.
  • pvCtx
    []:
    Pointer to a private context controlled by the value model. A complex value model may need access to specialized information not normally available when accessing the data stored in the model. This pointer is passed to the model's PFNTADAPTGET function when the model has been asked to retrieve the data.
Prototype
   void ITypedValueModel_AdaptGet(ITypedValueModel *pif, PFNADTAPTGET pfn, void *pvCtx); 
Return
None
Side Effect
None
Comment
ITypedValueModel_AdaptGet() sets up the adaptive get callback function and the private context data used by the callback -- it does _not_ actually get the data stored in the value model. To retrieve specific pieces of data from the data store, models should call ITypedValueModel_GetValue() after first initializing the callback via ITypedValueModel_AdaptGet().
  • Follow