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 | List of all members
ctkCmdLineModuleBackendLocalProcess Class Reference

Provides an ctkCmdLineModuleBackend implementation to run a locally installed command line application. More...

#include <Libs/CommandLineModules/Backend/LocalProcess/ctkCmdLineModuleBackendLocalProcess.h>

Inheritance diagram for ctkCmdLineModuleBackendLocalProcess:
Inheritance graph
[legend]
Collaboration diagram for ctkCmdLineModuleBackendLocalProcess:
Collaboration graph
[legend]

Public Member Functions

 ctkCmdLineModuleBackendLocalProcess ()
 
virtual QString description () const
 Returns a brief description of the type of the backend. More...
 
virtual QString name () const
 Returns the name of the type of the backend, not the name of the thing or application that is run. More...
 
virtual QByteArray rawXmlDescription (const QUrl &location, int timeout)
 Get the raw XML description from the module at location. More...
 
virtual ctkCmdLineModuleFuture run (ctkCmdLineModuleFrontend *frontend)
 Run a front-end for this module in a local process. More...
 
virtual QList< QString > schemes () const
 This back-end can handle the "file" URL scheme. More...
 
void setTimeOutForXMLRetrieval (int timeOut)
 Setter for the number of milliseconds to wait when retrieving xml. More...
 
virtual int timeOutForXMLRetrieval () const
 Returns the number of milliseconds to wait when retrieving xml. More...
 
virtual qint64 timeStamp (const QUrl &location) const
 Returns the last modified time of the module at location. More...
 
 ~ctkCmdLineModuleBackendLocalProcess ()
 
- Public Member Functions inherited from ctkCmdLineModuleBackend
QByteArray rawXmlDescription (const QUrl &location)
 Get the XML parameter description from the given location. More...
 
virtual int timeOutForXmlRetrieval () const
 returns the number of milliseconds to wait when retrieving xml. More...
 
virtual ~ctkCmdLineModuleBackend ()
 

Additional Inherited Members

Detailed Description

Provides an ctkCmdLineModuleBackend implementation to run a locally installed command line application.

Use this back-end if you want to be able to register local executables as command line modules. The back-end handles the "file" URL scheme, allowing you to register modules with the ctkCmdLineModuleManager by using

ctkCmdLineModuleManager::registerModule(QUrl::fromLocalFile("/path/to/executable"));
ctkCmdLineModuleReference registerModule(const QUrl &location)
Registers a module, identified by the given URL.

The XML description for a module is extracted from the standard output of the executable when calling it with the ––xml command line argument.

The ctkCmdLineModuleFuture returned by run() allows cancelation by killing the running process. On Unix systems, it also allows to pause it.

Definition at line 52 of file ctkCmdLineModuleBackendLocalProcess.h.

Constructor & Destructor Documentation

◆ ctkCmdLineModuleBackendLocalProcess()

ctkCmdLineModuleBackendLocalProcess::ctkCmdLineModuleBackendLocalProcess ( )

◆ ~ctkCmdLineModuleBackendLocalProcess()

ctkCmdLineModuleBackendLocalProcess::~ctkCmdLineModuleBackendLocalProcess ( )

Member Function Documentation

◆ description()

virtual QString ctkCmdLineModuleBackendLocalProcess::description ( ) const
virtual

Returns a brief description of the type of the backend.

Returns
A QString containing a description.

Implements ctkCmdLineModuleBackend.

◆ name()

virtual QString ctkCmdLineModuleBackendLocalProcess::name ( ) const
virtual

Returns the name of the type of the backend, not the name of the thing or application that is run.

Returns
A QString containing the name.

Implements ctkCmdLineModuleBackend.

◆ rawXmlDescription()

virtual QByteArray ctkCmdLineModuleBackendLocalProcess::rawXmlDescription ( const QUrl &  location,
int  timeout 
)
virtual

Get the raw XML description from the module at location.

Parameters
locationThe location URL of the module for which to get the XML description.
Returns
The raw XML description.

This method always calls the executable with a ––xml argument and returns the complete data emitted on the standard output channel.

Implements ctkCmdLineModuleBackend.

◆ run()

virtual ctkCmdLineModuleFuture ctkCmdLineModuleBackendLocalProcess::run ( ctkCmdLineModuleFrontend frontend)
virtual

Run a front-end for this module in a local process.

Parameters
frontendThe front-end to run.
Returns
A future object for communicating with the running process.

Implements ctkCmdLineModuleBackend.

◆ schemes()

virtual QList<QString> ctkCmdLineModuleBackendLocalProcess::schemes ( ) const
virtual

This back-end can handle the "file" URL scheme.

Returns
Returns the schemes this back-end can handle.

Implements ctkCmdLineModuleBackend.

◆ setTimeOutForXMLRetrieval()

void ctkCmdLineModuleBackendLocalProcess::setTimeOutForXMLRetrieval ( int  timeOut)

Setter for the number of milliseconds to wait when retrieving xml.

Parameters
timeOutin milliseconds.

◆ timeOutForXMLRetrieval()

virtual int ctkCmdLineModuleBackendLocalProcess::timeOutForXMLRetrieval ( ) const
virtual

Returns the number of milliseconds to wait when retrieving xml.

Returns
Time-out in milliseconds.

◆ timeStamp()

virtual qint64 ctkCmdLineModuleBackendLocalProcess::timeStamp ( const QUrl &  location) const
virtual

Returns the last modified time of the module at location.

Parameters
locationThe location URL of the module for which to get the timestamp.
Returns
A timestamp.

Implements ctkCmdLineModuleBackend.


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