CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
Public Member Functions | Static Public Attributes | List of all members
ctkApplicationHandle Struct Referenceabstract

#include <Libs/PluginFramework/service/application/ctkApplicationHandle.h>

Public Member Functions

virtual void destroy ()=0
 
virtual ctkApplicationDescriptorgetApplicationDescriptor () 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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ~ctkApplicationHandle()

virtual ctkApplicationHandle::~ctkApplicationHandle ( )
inlinevirtual

Definition at line 79 of file ctkApplicationHandle.h.

Member Function Documentation

◆ destroy()

virtual void ctkApplicationHandle::destroy ( )
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.

Exceptions
ctkIllegalStateExceptionif the application handle is unregistered

◆ getApplicationDescriptor()

virtual ctkApplicationDescriptor* ctkApplicationHandle::getApplicationDescriptor ( ) const
pure virtual

Retrieves the IApplicationDescriptor to which this IApplicationHandle belongs.

Returns
The corresponding IApplicationDescriptor

◆ getExitValue()

virtual QVariant ctkApplicationHandle::getExitValue ( long  timeout) const
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.

  • positive - The method waits until the application terminates or the timeout expires. If the timeout expires and the application has not terminated then an ctkApplicationException is thrown.
Parameters
timeoutThe maximum time in milliseconds to wait for the application to timeout.
Returns
The exit value for the application instance. The value is application specific.
Exceptions
ctkUnsupportedOperationExceptionIf the application model does not support exit values.
ctkApplicationExceptionIf the application has not terminated. The error code will be ctkApplicationException::APPLICATION_EXITVALUE_NOT_AVAILABLE.

◆ getInstanceId()

virtual QString ctkApplicationHandle::getInstanceId ( ) const
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.

Returns
the unique identifier of the instance

◆ getState()

virtual QString ctkApplicationHandle::getState ( ) const
pure virtual

Get the state of the application instance.

Returns
the state of the application.
Exceptions
ctkIllegalStateExceptionif the application handle is unregistered

Member Data Documentation

◆ APPLICATION_DESCRIPTOR

const QString ctkApplicationHandle::APPLICATION_DESCRIPTOR
static

The property key for the pid of the corresponding application descriptor.

Definition at line 52 of file ctkApplicationHandle.h.

◆ APPLICATION_PID

const QString ctkApplicationHandle::APPLICATION_PID
static

The property key for the unique identifier (PID) of the application instance.

Definition at line 47 of file ctkApplicationHandle.h.

◆ APPLICATION_STATE

const QString ctkApplicationHandle::APPLICATION_STATE
static

The property key for the state of this application instance.

Definition at line 57 of file ctkApplicationHandle.h.

◆ APPLICATION_SUPPORTS_EXITVALUE

const QString ctkApplicationHandle::APPLICATION_SUPPORTS_EXITVALUE
static

The property key for the supports exit value property of this application instance.

Definition at line 63 of file ctkApplicationHandle.h.

◆ RUNNING

const QString ctkApplicationHandle::RUNNING
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.

◆ STOPPING

const QString ctkApplicationHandle::STOPPING
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.


The documentation for this struct was generated from the following file: