Herqq
|
This abstract class is used as a base for identifying an asynchronous operation and detail information of it. More...
#include <HAsyncOp>
Public Member Functions | |
virtual | ~HAsyncOp ()=0 |
QString | errorDescription () const |
void | setErrorDescription (const QString &arg) |
int | returnValue () const |
void | setReturnValue (int returnValue) |
unsigned int | id () const |
bool | isNull () const |
bool | operator! () const |
virtual void | abort () |
Protected Member Functions | |
HAsyncOp () | |
HAsyncOp (qint32 returnCode, const QString &errorDescription) | |
HAsyncOp (const HAsyncOp &) | |
HAsyncOp & | operator= (const HAsyncOp &) |
This abstract class is used as a base for identifying an asynchronous operation and detail information of it.
Some HUPnP components provide an asynchronous interface for running possible long-standing operations. A most notable example of this is the client-side action invocation initiated with HClientAction::beginInvoke(). In cases like this, the class running the operation returns a derivative of this class, which is used to identify and describe the running operation.
The component that runs an asynchronous operation provides an instance derived from this class when the operation is started. A copy of that instance is provided also when the component signals the operation is complete. The provided instance uniquely identifies the operation, carries information whether the operation eventually succeeded or not and it may contain an error description in case of an error.
For example:
HClientActionOp op = someActionObject->beginInvoke(); // // The operation completes, after which you can: // int retVal = op.returnValue(); // retrieve a return value indicating whether the operation succeeded. QString errDescr = op.errorDescription(); // retrieve an error description if the operation failed.
HAsyncOp | ( | ) | [protected] |
HAsyncOp | ( | qint32 | returnCode, |
const QString & | errorDescription | ||
) | [protected] |
Creates a new instance, invalid instance.
returnCode | specifies the return code. |
errorDescription | specifies a human-readable description of the error that occurred. |
Copy constructor.
Creates a shallow copy of other increasing the reference count of other.
~HAsyncOp | ( | ) | [pure virtual] |
Destroys the instance.
Decreases the reference count or destroys the instance once the reference count drops to zero.
Assignment operator.
Switches this instance to refer to the contents of other increasing the reference count of other.
QString errorDescription | ( | ) | const |
Returns a human readable error description.
void setErrorDescription | ( | const QString & | arg | ) |
Sets a human readable error description.
arg | specifies the human readable error description. |
int returnValue | ( | ) | const |
Returns the return value of the asynchronous operation.
void setReturnValue | ( | int | returnValue | ) |
Sets the return value of the asynchronous operation.
returnValue | specifies the return value of the asynchronous operation. |
unsigned int id | ( | ) | const |
Returns an identifier of the asynchronous operation.
bool isNull | ( | ) | const |
Indicates whether the object identifies an asynchronous operation.
true | in case the object does not identify an asynchronous operation. This is usually the case when an operation was not successfully started. |
false | in case the object identifies an asynchronous operation. |
bool operator! | ( | ) | const [inline] |
Indicates whether the object identifies an asynchronous operation.
This is a convenience method and it is semantically equivalent with isNull().
true | in case the object does not identify an asynchronous operation. This is usually the case when an operation was not successfully started. |
false | in case the object identifies an asynchronous operation. |
void abort | ( | ) | [virtual] |
Aborts the execution of the operation.
Aborts the execution of the operation.