Get method overview

The Get method is called to obtain data from a resource for input to a map.

The Get method is called for an input card, GET function, or for a DBLOOKUP and DBQUERY if the source is a database. The call accesses the resource for which the hConnection handle is associated and returns data. This data is passed to the map server through a stream object.
MPIRC Get (HMPIADAPT  hAdapter,HMPICONNECT  
hConnection)

Inputs

hAdapter
Adapter handle
hConnection
Connection handle

Outputs

None

Returns

Success status

The method should get a single unit of work from the input (for example, a result set from a database query, a file, or a message from a queue), and return the unit of work through a stream object associated with the MPIP_ADAPTER_DATA_FROM_ADAPT property. For example:
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.