Provides a back-end implementation to enable directly calling a function pointer.
More...
#include <Libs/CommandLineModules/Backend/FunctionPointer/ctkCmdLineModuleBackendFunctionPointer.h>
|
| ctkCmdLineModuleBackendFunctionPointer () |
|
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 XML parameter description from the given location. More...
|
|
QList< QUrl > | registeredFunctionPointers () const |
|
template<typename A > |
Description * | registerFunctionPointer (const QString &title, void(*fp)(A), const QString ¶mLabel=QString(), const QString ¶mDescr=QString()) |
|
template<typename A , typename B > |
Description * | registerFunctionPointer (const QString &title, void(*fp)(A, B), const QString ¶mLabel0=QString(), const QString ¶mDescr0=QString(), const QString ¶mLabel1=QString(), const QString ¶mDescr1=QString()) |
|
virtual QList< QString > | schemes () const |
| Returns a list of URL schemes this back-end can handle. More...
|
|
virtual qint64 | timeStamp (const QUrl &location) const |
| Returns a timestap of the backend, which for example in the case of the LocalProcess may be the last modified time of the command line application. More...
|
|
| ~ctkCmdLineModuleBackendFunctionPointer () |
|
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 () |
|
Provides a back-end implementation to enable directly calling a function pointer.
- Warning
- This back-end is highly experimental and will not work for most function pointers when trying to register them via registerFunctionPointer().
Definition at line 102 of file ctkCmdLineModuleBackendFunctionPointer.h.
◆ ctkCmdLineModuleBackendFunctionPointer()
ctkCmdLineModuleBackendFunctionPointer::ctkCmdLineModuleBackendFunctionPointer |
( |
| ) |
|
◆ ~ctkCmdLineModuleBackendFunctionPointer()
ctkCmdLineModuleBackendFunctionPointer::~ctkCmdLineModuleBackendFunctionPointer |
( |
| ) |
|
◆ arguments()
◆ description()
virtual QString ctkCmdLineModuleBackendFunctionPointer::description |
( |
| ) |
const |
|
virtual |
Returns a brief description of the type of the backend.
- Returns
- A QString containing a description.
Implements ctkCmdLineModuleBackend.
◆ name()
virtual QString ctkCmdLineModuleBackendFunctionPointer::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 ctkCmdLineModuleBackendFunctionPointer::rawXmlDescription |
( |
const QUrl & |
location, |
|
|
int |
timeout |
|
) |
| |
|
virtual |
Get the XML parameter description from the given location.
- Parameters
-
location | The location URL specifying the module. |
timeout | The time-out for retrieving the XML parameter description |
- Returns
- The raw XML parameter description.
This method may be concurrently called by the ctkCmdLineModuleManager and must be thread-safe. Implementations must not use any caching mechanism, as caching is done by the ctkCmdLineModuleManager itself, checking the return value of timeStamp().
Implementations should also throw either a ctkCmdLineModuleTimeoutException object if a time-out occured when retrieving the XML parameter description or a ctkCmdLineModuleRunException for any other error during invocation of the module.
- Exceptions
-
Implements ctkCmdLineModuleBackend.
◆ registeredFunctionPointers()
QList<QUrl> ctkCmdLineModuleBackendFunctionPointer::registeredFunctionPointers |
( |
| ) |
const |
◆ registerFunctionPointer() [1/2]
template<typename A >
Description* ctkCmdLineModuleBackendFunctionPointer::registerFunctionPointer |
( |
const QString & |
title, |
|
|
void(*)(A) |
fp, |
|
|
const QString & |
paramLabel = QString() , |
|
|
const QString & |
paramDescr = QString() |
|
) |
| |
|
inline |
◆ registerFunctionPointer() [2/2]
template<typename A , typename B >
Description* ctkCmdLineModuleBackendFunctionPointer::registerFunctionPointer |
( |
const QString & |
title, |
|
|
void(*)(A, B) |
fp, |
|
|
const QString & |
paramLabel0 = QString() , |
|
|
const QString & |
paramDescr0 = QString() , |
|
|
const QString & |
paramLabel1 = QString() , |
|
|
const QString & |
paramDescr1 = QString() |
|
) |
| |
|
inline |
◆ run()
The main method to actually execute the back-end process.
- Parameters
-
frontend | A pointer to a front end implementation. |
Implementations must execute the actual task of running the module asynchronously and return from this method immediately. After returning from this method, accessing the frontend
pointer is not guaranteed to be safe.
Implements ctkCmdLineModuleBackend.
◆ schemes()
virtual QList<QString> ctkCmdLineModuleBackendFunctionPointer::schemes |
( |
| ) |
const |
|
virtual |
Returns a list of URL schemes this back-end can handle.
- Returns
- A list of "schemes", meaning the capabilities.
Implements ctkCmdLineModuleBackend.
◆ timeStamp()
virtual qint64 ctkCmdLineModuleBackendFunctionPointer::timeStamp |
( |
const QUrl & |
location | ) |
const |
|
virtual |
Returns a timestap of the backend, which for example in the case of the LocalProcess may be the last modified time of the command line application.
Implements ctkCmdLineModuleBackend.
The documentation for this class was generated from the following file: