Returns data after a refresh. This data is returned one data item of one row at a time.
SMC_RETURN_CODE smc_get_dataitem_value (SMC_CONNECT_ID clientId, SMC_VIEW_ID viewId, SMC_DATAITEM_STRUCTP dataItemHandle, SMC_SIZET row, SMC_VALUE_UNIONP returnVal)
identifies the connection.
identifies a view created on the connection.
pointer to data item and statistic type.
row number of requested data.
return value that contains the value of one data item.
Return value |
Indicates |
---|---|
SMC_RET_SUCCESS |
Function succeeded. |
SMC_RET_FAILURE |
Function failed. |
SMC_RET_INVALID_CONNECT |
No connection exists with the specified ID. |
The following example assumes that:
You have created a connection and have a clientId.
You have created a view on that connection and have a viewId.
The view contains the dataItem defined in the example.
You have successfully executed a refresh call.
The row count is greater than zero.
SMC_DATAITEM_STRUCT dataItem = { SMC_NAME_PAGE_LOGICAL_READ, SMC_STAT_VALUE_SAMPLE }; SMC_DATAITEM_STRUCTP dataItemHandle = &dataItem;
SMC_VALUE_UNION returnValue; SMC_VALUE_UNIONP returnValueHandle = &returnValue;
if (smc_get_dataitem_value(clientId, viewId, dataItemHandle, 0, /* row number */ returnValueHandle) != SMC_RET_SUCCESS) { printf("smc_get_dataitem_value failed\n"); /* do some cleanup */ }
The first row of data is indexed by row number zero, the second by one, and so on.
For data of type SMC_DI_TYPE_CHARP, the Monitor Client Library allocates the memory. The calling application must deallocate the memory using free().
See Appendix B, “Datatypes and Structures” for a listing of members in SMC_VALUE_UNION.
See the mctype.sh include file or Appendix B, “Datatypes and Structures” for the values for enumerated types.
Error |
Indicates |
---|---|
SMC_RET_INVALID_VIEWID |
View does not exist. |
SMC_RET_INVALID_DINAME |
Invalid data item. |
SMC_RET_INVALID_DISTAT |
Invalid data item statistic type. |
SMC_RET_INVALID_PARAMETER |
Invalid parameter. |
smc_refresh_ex, smc_get_dataitem_type