Extracting Operation Results

Since operation results take the form of lists of ostc_Objects, you must extract the fundamental values making up the result by

Example

      ostc_Object * account = 0;
      account = result->first();
      printf("%-20.15s%15f\n", 
            from_name, account->getFloatValue("val"));

      account = result->next();
      printf(
            "%-20.15s%15f\n",
            account->getStringValue("name"),
            account->getFloatValue("val")
      );

Click here for the example in context.

Get-Value Functions

ostc_Object defines functions for getting attributes with values of each fundamental OSTC type:

ostc_Object::getInt32Value()
ostc_Object::getInt64Value()
ostc_Object::getStringValue()
ostc_Object::getFloatValue()
ostc_Object::getDoubleValue()
ostc_Object::getObjectValue()
ostc_Object::getBinaryValue()

These functions return the attribute value. You can also use the various overloadings of ostc_Object::getValue(), which assign the value to a variable that you pass in.



[previous] [next]