A client-side class that represents a server-side UPnP action. More...
#include <HClientAction>
Inherited by HDefaultClientAction.
Signals | |
void | invokeComplete (Herqq::Upnp::HAsyncOp asyncOp, const Herqq::Upnp::HActionArguments &outArgs) |
Public Member Functions | |
virtual | ~HClientAction ()=0 |
HClientService * | parentService () const |
const HActionInfo & | info () const |
HAsyncOp | beginInvoke (const HActionArguments &inArgs, HExecArgs *execArgs=0) |
HAsyncOp | beginInvoke (const HActionArguments &inArgs, const HActionInvokeCallback &completionCallback, HExecArgs *execArgs=0) |
Protected Member Functions | |
HClientAction (const HActionInfo &info, HClientService *parent) |
HClientAction
is a core component of the HUPnP's client-side Device Model and it models a UPnP action. The UPnP Device Architecture specifies a UPnP action as a command, which takes one or more input and output arguments and that may have a return value.
This class is used to invoke the server-side UPnP actions from the client-side. You can get information of the action using info(), which includes the action's input and output arguments. You can dispatch an asynchronous action invocation to the server-side using beginInvoke(). Once the server responds, invokeComplete() signal is sent.
HClientAction | ( | const HActionInfo & | info, |
HClientService * | parent | ||
) | [protected] |
Creates a new instance.
info | specifies information of the action. |
parent | specifies the UPnP service that contains this action. |
~HClientAction | ( | ) | [pure virtual] |
Destroys the instance.
An HClientAction
is always destroyed by the HClientAction
that contains it when it is being deleted. Further, unless you hold the ownership of the HClientAction
instance, you should never destroy it.
HClientService * parentService | ( | ) | const |
Returns the parent service of the action.
HClientAction
exists, which ultimately is as long as the containing root device exists.const HActionInfo & info | ( | ) | const |
Returns information about the action that is read from the service description.
HAsyncOp beginInvoke | ( | const HActionArguments & | inArgs, |
HExecArgs * | execArgs = 0 |
||
) |
Schedules the action to be invoked.
The method performs an asynchronous action invocation. The invocation is placed in a queue and it will be run once it's at the head of the queue.
Unless you specified the action to be executed as fire and forget, the signal invokeComplete() is emitted once the invocation is complete.
inArgs | specifies the input arguments for the action invocation. |
execArgs | specifies information used to control the execution of the action invocation procedure. This is optional. |
HAsyncOp beginInvoke | ( | const HActionArguments & | inArgs, |
const HActionInvokeCallback & | completionCallback, | ||
HExecArgs * | execArgs = 0 |
||
) |
Schedules the action to be invoked.
The method performs an asynchronous action invocation. The invocation is placed in a queue and it will be run once it's at the head of the queue.
Unless you specified the action to be executed as fire and forget, the specified callback is called when the invocation is complete. No events are sent unless that is explicitly requested by returning true from the callback function.
The different semantics compared to the other beginInvoke() method are important to notice:
inArgs | specifies the input arguments for the action invocation |
completionCallback | specifies the callable entity that is called once the action invocation is completed or failed. If the specified callable entity is not valid and it cannot be called, the callable entity is ignored and the invokeComplete() signal is sent sent instead. |
execArgs | specifies information used to control the execution of the action invocation procedure. This is optional. |
void invokeComplete | ( | Herqq::Upnp::HAsyncOp | asyncOp, |
const Herqq::Upnp::HActionArguments & | outArgs | ||
) | [signal] |
Unless an invocation was started as fire and forget, this signal is emitted when the invocation has been successfully completed or the invocation failed.
asyncOp | identifies the asynchronous operation that completed. |
outArgs | specifies the output arguments of the action invocation. |