Developer

API Reference

IValueModel_GetValue()

Brew Release
Brew MP 1.0.2
See Also
- IValueModel
- PFNADAPTGET
- IValueModel_AdaptGet
Description
This function retrieves all of the data stored in a value model. The data may be very simple or arbitrarily complex. In either case, the entire data store (or a pointer to the data) is returned. The data returned by IValueModel_GetValue may be typed as appropriate for the data being returned. For example, a model value that stores its data as an integer would simply return the retrieved data as an int, whereas a more complex model value -- say, one that stores seasonal statistics for major league baseball players -- could return a pointer to a complex data structure (with fields containing at bats, homeruns, hits, etc...).
Parameters
  • pif
    []:
    Pointer to the IValueModel interface object.
  • pnLen
    []:
    Pointer into which the value model will store the length of the data being returned. Pass NULL to indicate that the length of the data is not required (i.e. when the value model is expected to return a data item that fits within the confines of a void pointer -- a boolean, int, short, etc...).
Interface
Prototype
   void *IValueModel_GetValue(IValueModel *pif, int *pnLen); 
Return
The type of data returned by IValueModel_GetValue() is determined by the data defined in the value model itself. For a simple value model in which the data may be stored in a data item that fits in a void pointer, the return value is the data itself. For more complex value models the return value may be a pointer to data -- or, NULL, if the complex data could not be retrieved.
Side Effect
None
Comment
IValueModel_GetValue() returns ALL of the data stored in the value model. To retrieve a specific portion of the data (a structure field, for example), a value model must first identify an adaptive get callback function and setup that callback by calling IValueModel_AdaptGet().
  • Follow