Wait for and return the interface definition of the Define Operation.
If the operation already has received a definition or an exception, this returns immediately with the same.
- Resource Management:
- This function allocates resources that must later be freed by calling DOFInterface_Destroy.
This blocks the caller until the operation has an interface definition or exception, the operation times out or is cancelled, or the timeout of this wait expires, whichever occurs first.
The time specified in this call has no relationship to the Operation itself; it only specifies how long this call will block the caller.
It is not safe to use this call if the operation's complete callback can result in a call to DOFOperation_Destroy (refer to that function's documentation for more information).
- Parameters
-
| op | The Operation. This must not be NULL and must represent a valid Define Operation. |
| timeout | The maximum time to wait for a result, in milliseconds. A value of 0 returns immediately. |
[out] | pException | An Exception. If pException is NULL , no exception is reported. Otherwise, the output is either a DOFException, or NULL to indicate no exception occurred. DOFException_Destroy must be called to destroy the returned DOFException, if any. |
- Returns
- The DOFInterface retrieved by the Define Operation, or NULL if an interface cannot be returned. There are two cases in which an interface cannot be returned:
- If the operation resulted in an exception, the exception is reported via pException, which will be non-NULL.
- If the operation does not receive an interface within the specified timeout, or the operation completes and does not have an interface within the specified timeout, pException will represent a DOFERROR_TIMEOUT.