Get method overview
The Get method is called to obtain data from a resource for input to a map.
MPIRC Get (HMPIADAPT hAdapter,HMPICONNECT
hConnection)
Inputs
- hAdapter
- Adapter handle
- hConnection
- Connection handle
Outputs
None
Returns
Success status
mpiPropertyGetObject (hAdapter,
MPIP_ADAPTER_DATA_FROM_ADAPT, 0, &hStream);
mpiStreamNewPage(hStream, &hPage, iSize);
mpiStreamPageGetInfo(hPage, &pData, &iSize);
get data into pData
mpiStreamWritePage(hStream, hPage);
Quantity
or FetchUnit values do not affect the adapter; this is handled by the Resource
Manager. Each call to Get should return a single unit of work. If Get is called from the GET mapping function (the MPIP_ADAPTER_CONTEXT will be set to MPI_CONTEXT_GET), data might be passed to the Get call from the third parameter in the GET mapping function. This applies to adapters that require data to be sent out in the form of a request, such that the corresponding reply is returned from the Get call.
To determine whether any data has been passed, the adapter should get the MPIP_ADAPTER_DATA_TO_ADAPT property. If this returns an MPIRC_NULL_OBJECT error, it means that no data was passed to the Get. If data was passed, use the stream object to get the data.
If Get is called as the result of an input event (the MPIP_ADAPTER_CONTEXT property is MPI_CONTEXT_SOURCE_EVENT), information about the event or events is obtained from the MPIP_ADAPTER_MSG_COLLECTION property by repeatedly calling mpiMsgCollGetNext until there are no more messages in the collection. These messages have previously been added to a collection by the adapter's Listen method.