Setting and Getting the Return Value or Values

ostc_OperationResult::setReturnValue()

void setReturnValue(os_collection*, os_cursor* = 0);

Call this function from ostc_ServerOperation::execute() to specify multiple return values.

If execute() passes a nonzero os_cursor* to ostc_OperationResult()::setReturnValue() (and does not pass a nonzero void* to setReturnValue()), the Server calls format() on each element that can be visited with the cursor.

If execute() passes a nonzero os_collection* to ostc_OperationResult()::setReturnValue() (and does not pass a nonzero void* or os_cursor* to setReturnValue()), the Server calls format() on each element of the collection.

void setReturnValue(void*);

Call this function from ostc_ServerOperation::execute() to specify a single return value.

If execute() passes a nonzero void* to setReturnValue(), the void* is considered to be the only return value, so the Server calls format() once, passing the void* as the value argument.

If you pass 0 to this function, ostc_ServerOperation::format() is not called, and (on the client side) ostc_Session::doOperation() returns 0.

ostc_OperationResult::GetReturnValue()

void GetReturnValue(os_collection*&, os_cursor*&);

Sets the arguments to the values passed to setReturnValue(). Sets the arguments to 0 if setReturnValue(os_collection*, os_cursor*) has not been called on this result. This function can be called from ostc_ServerOperation::operationComplete().

void GetReturnValue(void*&);

Sets the argument to the value passed to setReturnValue(). Sets the argument to 0 if setReturnValue(void*) has not been called on this result. This function can be called from ostc_ServerOperation::operationComplete().



[previous] [next]