ullaResultCode_t ullaResultStatus(const ullaResultId_t urId);
ullaResultCode_t ullaResultTuple(const ullaResultId_t urId, ullaTupleId_t *utId);
void ullaResultFree(const ullaResultId_t urId);
In order to access the data from the ULLA result, the Link User (LU), or application using ULLA, can utilize the accessor functions. The ULLA result is structured using tuples and fields. Using a tupleId the LU can iterate over the "rows" in the ullaResult. Each tuple has as a the same number of fields, according to the uql_statement used. The order of the attribute or command names in the uqp_statement determines the order the data is stored into the ULLA result fields. Please consult ullaTuple(2) as a reference to the various accessor function to field entries.
int ullaResultStatus is used to check the status of the respective ullaResult. It may be freed already or still valid. The return code of the function is either ULLA_OK or an error code (see below).
int ullaResultTuple will return a tupleId to be used with the ullaTuple(2) accessor functions.
int ullaResultFree is required to free the ullaResult after all data has been extracted.
How-to access the tuples of an ullaResult:
#include <ulla/lu.h>
ullaResultCode_t res;
ullaResultId_t urId;
ullaTupleId_t utId;
if( (res = ullaRequestAttributes("SELECT linkId FROM ullaLink", &urId,
0)) < 0) {
/* failed to perform query */
}
if( (res = ullaResultTuple(urId, &utId)) < 0) {
/* failed to access tuples from ullaResult */
/* verify status of the ullaResult if shared among threads */
}
ullaResultFree(urId);
How-to check ullaResult status:
status = ullaResultStatus(&urId);
switch(status)
{
case ULLA_ERROR_IN_VALUE:
/* result data freed */
break;
case ULLA_ERROR_OK:
/* result data still valid */
break;
}
ulla(2) , uql(2) , ullaResult(2) , ullaTuple(2) , ullaRequestReflection(2) , ullaRequestAttribute(2) , ullaRequestCommand(2) , ullaRequestNotification(2) , ullaRequestSample(2) , ullaRequestLock(2) , ullaGetCoreDescriptor(2)