tibasSpace_CompareAndPut()

Specifies a tuple to look for. If the old value is unmodified, replaces the existing tuple with the specified value.

Declaration

tibas_status tibasSpace_CompareAndPut(
    tibasSpace  space,
    tibasTuple* value,
    tibasTuple  oldValue,
    tibasTuple  newValue)

Parameters

Parameter Description
space The TIBCO ActiveSpaces entity on which the function is invoked.
value Returns the value of the tuple.
oldValue A tuple containing the value to look for.
newValue A tuple containing a new value to replace the old value.

Remarks

Use the tibasSpace_CompareAndPut() function to search for a specified tuple in a specified space and, if the value specified in the oldValue parameter is unmodified, replace the tuple with a specified new value.

If there is a mismatch, the function returns the existing value in the space. If the operation is successful, the returned tuple will be same as the new tuple passed to the function. Otherwise, the return will be a different object.