Workspace 6.21.5
|
Runs an operation or workspace. The OperationRunner can be used to run a workspace or operation. To use simply construct the with a path to a workspace file, existing workspace or operation. WARNING: If your client code decides to perform its own wait logic then use the OperationRunner isRunning method and not the isRunning method on your provided Workspace.
#include <Workspace/DataExecution/Execution/operationrunner.h>
Inherits QObject.
Classes | |
struct | OperationRunnerDeleter |
Public Types | |
using | unique_ptr = std::unique_ptr< OperationRunner, OperationRunnerDeleter > |
Signals | |
void | errorReported () |
void | failed () |
void | finished (bool success) |
void | succeeded () |
Public Member Functions | |
OperationRunner ()=delete | |
OperationRunner (const OperationFactory &) | |
OperationRunner (const OperationRunner &)=delete | |
OperationRunner (const QString &workspacePath) | |
OperationRunner (Workspace &workspace) | |
~OperationRunner () override | |
IOBase * | getGlobalNameIOBase (const QString &globalName) |
template<typename T > | |
T & | getGlobalNameValue (const QString &globalName) |
InputScalar * | getInput (const QString &inputName, int index=0) |
InputArray * | getInputArray (const QString &inputName) |
template<typename T > | |
T & | getInputValue (const QString &inputName, int index=0) |
Operation * | getOperation () |
template<typename O > | |
O * | getOperation () |
Output * | getOutput (const QString &outputName) |
template<typename T > | |
T & | getOutputValue (const QString &outputName) |
Updater * | getUpdater () |
Workspace * | getWorkspace () |
bool | hasInput (const QString &inputName, int index=0) |
bool | hasSucceeded () const |
bool | isLoaded () const |
bool | isRunning () |
OperationRunner & | operator= (const OperationRunner &)=delete |
bool | runContinuously () |
bool | runOnce () |
bool | runOnceAndWait () |
void | setGlobalNameDataObject (const QString &globalName, const DataObject &dataObject) |
template<typename T > | |
void | setGlobalNameValue (const QString &globalName, const T &value) |
template<typename T > | |
void | setGlobalNameValueByReference (const QString &globalName, T &value) |
template<typename T > | |
void | setInputValue (const QString &inputName, const T &value, int index=0) |
template<typename T > | |
void | setInputValueByReference (const QString &inputName, T &value, int index=0) |
void | stop () |
void | stopAndWait () |
template<typename F > | |
UpdatablesObserver< F > * | watchUpdatable (F callable, Updatable &updatable, ObserverThreadType threadingModel=UnthreadedObserver, bool singleShot=true) |
template<typename ReceiverType , typename ReturnType > | |
UpdatablesMonitor< ReceiverType, ReturnType > * | watchUpdatable (ReceiverType &receiver, ReturnType(ReceiverType::*func)(), Updatable &updatable, ObserverThreadType threadingModel=UnthreadedObserver, bool singleShot=true) |
template<typename F > | |
UpdatablesObserver< F > * | watchUpdatables (F callable, Updatables &updatables, ObserverThreadType threadingModel=UnthreadedObserver, bool singleShot=true) |
template<typename ReceiverType , typename ReturnType > | |
UpdatablesMonitor< ReceiverType, ReturnType > * | watchUpdatables (ReceiverType &receiver, ReturnType(ReceiverType::*func)(), Updatables &updatables, ObserverThreadType threadingModel=UnthreadedObserver, bool singleShot=true) |
Static Public Member Functions | |
template<typename T > | |
static unique_ptr | create () |
static unique_ptr | create (const OperationFactory &) |
static unique_ptr | create (const QString &workspacePath) |
static unique_ptr | create (Workspace &workspace) |
Protected Slots | |
void | onAborted (QString, bool hasErrorSource) |
void | onFinished (QString) |
void | onSucceeded (QString) |
Protected Member Functions | |
void | observe (Workspace &) |
void | reset () |
template<typename T > | |
void | setInputByReference (InputScalar &input, T &value) |
Static Protected Member Functions | |
static void | setInputValue (InputScalar &input, const DataObject &dataObject) |
template<typename T > | |
static void | setInputValue (InputScalar &input, const T &value) |
using unique_ptr = std::unique_ptr<OperationRunner, OperationRunnerDeleter> |
|
explicit |
forward to internl call
|
explicit |
forward to internl call
|
explicit |
forward to internl call
|
delete |
|
delete |
|
override |
OperationRunner destructor.
|
static |
Convenience template to create an OperationRunner for a specific Operation type
|
static |
Handy creator method to help creating the OperationRunner on the right thread.
|
static |
Handy creator method to help creating the OperationRunner on the right thread.
|
static |
Handy creator method to help creating the OperationRunner on the right thread.
|
signal |
|
signal |
|
signal |
IOBase * getGlobalNameIOBase | ( | const QString & | globalName | ) |
Gets an IOBase that has the named globalName attached to it.
T & getGlobalNameValue | ( | const QString & | globalName | ) |
Returns the value associated with the provided globalname on an input / output.
InvalidIONameError |
InputScalar * getInput | ( | const QString & | inputName, |
int | index = 0 |
||
) |
Returns an input on the workspace or operation to be run.
InvalidIONameError |
InputArray * getInputArray | ( | const QString & | inputName | ) |
Returns an InputArray on the workspace or operation to be run.
InvalidIONameError |
T & getInputValue | ( | const QString & | inputName, |
int | index = 0 |
||
) |
Returns the value associated with the provided input.
InvalidIONameError |
Operation * getOperation | ( | ) |
Returns a pointer to the workspace or operation provided to the OperationRunner.
O * getOperation |
Output * getOutput | ( | const QString & | outputName | ) |
Gets an output on the operation or workspace to be run.
InvalidIONameError |
|
inline |
Gets an output value on the operation or workspace to be run.
InvalidIONameError |
Updater * getUpdater | ( | ) |
Workspace * getWorkspace | ( | ) |
Returns a pointer to the root workspace being used by the OperationRunner.
bool hasInput | ( | const QString & | inputName, |
int | index = 0 |
||
) |
inputName | The name of the input |
index | If the input is an array, the index being queried |
bool hasSucceeded | ( | ) | const |
Returns true if the workflow has been executed successfully, false otherwise
bool isLoaded | ( | ) | const |
Returns true if the provided workspace (or workspace that hosts a provided operation) has been successfuly loaded / constructed.
bool isRunning | ( | ) |
Returns true if the OperationRunner is running.
|
protected |
|
protectedslot |
|
protectedslot |
|
protectedslot |
|
delete |
|
protected |
bool runContinuously | ( | ) |
Runs the operation continuously in a non-blocking fashion.
bool runOnce | ( | ) |
Runs the operation once in a non-blocking fashion.
bool runOnceAndWait | ( | ) |
Performs a single update of the operation in a blocking fashion and returns true if the operation ran successfully or false if it failed.
|
inline |
Assigns a DataObject to a globally named InputScalar. The InputScalar's DataObject factory must match the new DataObject's factory.
InvalidIONameError |
|
inline |
Sets a global name value on the workspace to be run.
InvalidIONameError |
|
inline |
Sets a global name value on the workspace to be run.
InvalidIONameError |
|
protected |
input | Reference to the input to modify. |
value | Reference to the data to assign (by reference) to the input. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. |
Setting any input by reference requires the Workspace to be stopped so the status flip can happen immediately. If the flip was delayed the input would clear the new shared data when it is later set out of date.
void setInputValue | ( | const QString & | inputName, |
const T & | value, | ||
int | index = 0 |
||
) |
Sets an input value on the operation or workspace to be run.
InvalidIONameError |
|
inlinestaticprotected |
|
inlinestaticprotected |
void setInputValueByReference | ( | const QString & | inputName, |
T & | value, | ||
int | index = 0 |
||
) |
Sets an input value on the operation or workspace by reference.
InvalidIONameError |
void stop | ( | ) |
Stops the operation asynchronously.
void stopAndWait | ( | ) |
Requests to stop the operation, blocking until it has finished running.
|
signal |
|
inline |
A convenience function that calls the function func when the Updatable object provided is simultaneously up-to-date.
callable | A callable object or function to invoke in response to the updatables being brought up-to-date. |
updatable | An updatable object to observe. |
threadingModel | The threading model to use for the receiver callback. |
singleShot | Whether or not the created observer should delete itself once the callback occurs. If false is provided, it is up to the calling code to delete the observer at a safe and appropriate time. |
Watches an Updatable, invoking the provided function callable when the Updatable is brought into an up-to-date state.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
receiver | The receiver of the callback |
func | The address of the function to callback on the receiver |
updatable | An Updatable object to watch |
threadingModel | The threading model in which the receiver will be called back |
singleShot | Whether or not the monitor will be invoked only the first time the updatables are brought up-to-date. |
Registers a callback function to be invoked when a provided Updatable object is up-to-date. The callback can be invoked only once (singleShot=true) or every time the updatable is brought up-to-date (singleShot=false).
|
inline |
A convenience function that calls the function func when all Updatable objects provided are simultaneously up-to-date.
callable | A callable object or function to invoke in response to the updatables being brought up-to-date. |
updatables | An updatable object to observe. |
threadingModel | The threading model to use for the receiver callback. |
singleShot | Whether or not the created observer should delete itself once the callback occurs. If false is provided, it is up to the calling code to delete the observer at a safe and appropriate time. |
Watches a set of Updatables, invoking the provided function callable when all of the Updatables are brought into an up-to-date state.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
receiver | The receiver of the callback |
func | The address of the function to callback on the receiver |
updatables | A set of updatable objects to watch |
threadingModel | The threading model in which the receiver will be called back |
singleShot | Whether or not the monitor will be invoked only the first time the updatables are brought up-to-date. |
Registers a callback function to be invoked when all provided Updatable objects are up to date. The callback can be invoked only once (singleShot=true) or every time the updatables are brought up-to-date (singleShot=false).