Using Callbacks With the IDLffDicomExStorScu Object
Callbacks from the IDLffDicomExStorScu object provide a way to transmit information back to the caller based on the status of a send operation. The value returned by the callback function is then used by the IDLffDicomExStorScu object to determine whether the send operation should continue.
The IDLffDicomExStorScu object allows you to define a single function (written in IDL) that will be called based on the intermediate status of a IDLffDicomExStorScu::Send method call. If a callback function is specified via the CALLBACK_FUNCTION property, it is called each time a DICOM file is sent to the remote node.
The callback function is invoked with an array of strings indicating status as the first parameter, and with the value (if any) specified by the CALLBACK_DATA property as the second parameter.
If the return value of the callback function is zero, the send operation will be cancelled. If the return value is one, the send operation will continue.
Callback Routine Signature
A send callback function is written in IDL and has the following signature:
where
- Callback_Function_Name is the name of the callback function. This value is specified as the value of the CALLBACK_FUNCTION property.
- StatusInfo is an array of strings that contain status information about the send operation. The status strings are provided for information and human inspection rather than for programmatic processing; the exact strings included in the array will depend on numerous factors including the status of the send and the type of node being sent to.
- CallbackData is the data specified via the CALLBACK_DATA property. The value of this property is passed to the callback function unmodified. If the CALLBACK_DATA property is unspecified, an integer zero is passed to the callback function as the value of this parameter.
The CallbackData parameter is useful for passing static information, such as the widget ID of a widget where the status information is displayed, from the IDLffDicomExStorScu object to the callback routine.
The return value of the callback function should be an integer zero or one. If the return value is zero, the send operation will be cancelled. If the return value is one, the send operation will continue.