![]() |
CTK
0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
|
#include <Libs/PluginFramework/service/application/ctkApplicationHandle.h>
Public Member Functions | |
virtual void | destroy ()=0 |
virtual ctkApplicationDescriptor * | getApplicationDescriptor () const =0 |
virtual QVariant | getExitValue (long timeout) const =0 |
virtual QString | getInstanceId () const =0 |
virtual QString | getState () const =0 |
virtual | ~ctkApplicationHandle () |
Static Public Attributes | |
static const QString | APPLICATION_DESCRIPTOR |
static const QString | APPLICATION_PID |
static const QString | APPLICATION_STATE |
static const QString | APPLICATION_SUPPORTS_EXITVALUE |
static const QString | RUNNING |
static const QString | STOPPING |
ApplicationHandle is a service interface which represents an instance of an application. It provides the functionality to query and manipulate the lifecycle state of the represented application instance. It defines constants for the lifecycle states.
Definition at line 40 of file ctkApplicationHandle.h.
|
inlinevirtual |
Definition at line 79 of file ctkApplicationHandle.h.
|
pure virtual |
The application instance's lifecycle state can be influenced by this method. It lets the application instance perform operations to stop the application safely, e.g. saving its state to a permanent storage.
The method must check if the lifecycle transition is valid; a STOPPING application cannot be stopped. If it is invalid then the method must exit. Otherwise the lifecycle state of the application instance must be set to STOPPING. Then the destroySpecific() method must be called to perform any application model specific steps for safe stopping of the represented application instance.
At the end the ctkApplicationHandle
must be unregistered. This method should free all the resources related to this ctkApplicationHandle
.
When this method is completed the application instance has already made its operations for safe stopping, the IApplicationHandle has been unregistered and its related resources has been freed. Further calls on this application should not be made because they may have unexpected results.
ctkIllegalStateException | if the application handle is unregistered |
|
pure virtual |
Retrieves the IApplicationDescriptor
to which this IApplicationHandle
belongs.
IApplicationDescriptor
|
pure virtual |
Returns the exit value for the application instance. The timeout specifies how the method behaves when the application has not yet terminated. A negative, zero or positive value may be used.
negative - The method does not wait for termination. If the application has not terminated then an ctkApplicationException
is thrown.
zero - The method waits until the application terminates.
ctkApplicationException
is thrown. timeout | The maximum time in milliseconds to wait for the application to timeout. |
ctkUnsupportedOperationException | If the application model does not support exit values. |
ctkApplicationException | If the application has not terminated. The error code will be ctkApplicationException::APPLICATION_EXITVALUE_NOT_AVAILABLE. |
|
pure virtual |
Returns the unique identifier of this instance. This value is also available as a service property of this application handle's service.pid.
|
pure virtual |
Get the state of the application instance.
ctkIllegalStateException | if the application handle is unregistered |
|
static |
The property key for the pid of the corresponding application descriptor.
Definition at line 52 of file ctkApplicationHandle.h.
|
static |
The property key for the unique identifier (PID) of the application instance.
Definition at line 47 of file ctkApplicationHandle.h.
|
static |
The property key for the state of this application instance.
Definition at line 57 of file ctkApplicationHandle.h.
|
static |
The property key for the supports exit value property of this application instance.
Definition at line 63 of file ctkApplicationHandle.h.
|
static |
The application instance is running. This is the initial state of a newly created application instance.
Definition at line 69 of file ctkApplicationHandle.h.
|
static |
The application instance is being stopped. This is the state of the application instance during the execution of the destroy()
method.
Definition at line 76 of file ctkApplicationHandle.h.