![]() |
Workspace 7.0.2
|
Base class for all operation factories. More...
#include <Workspace/DataExecution/Operations/operationfactory.h>
Public Member Functions | |
virtual | ~OperationFactory ()=default |
virtual Operation * | create () const =0 |
virtual void | destroy (Operation *op) const =0 |
virtual QString | getCataloguePath () const =0 |
virtual QString | getDefaultIconPath () const =0 |
virtual QString | getDeprecationMessage () const =0 |
QString | getHeaderPath () const |
virtual const Application::WorkspacePlugin & | getPlugin () const =0 |
virtual QString | getSourceTreeTop () const =0 |
virtual QString | getType () const =0 |
virtual bool | isDeprecated () const =0 |
virtual bool | isWorkspaceType () const =0 |
An operation factory is responsible for creating and destroying new operations of a specific type. The workspace application will build up a list of operation factories and select the appropriate factory as required to manage all the operations it needs.
Apart from actually creating and destroying operations, the other main responsibility of a factory is to ensure it provides a unique module name and that this name doesn't change. Any change to the module name or the type of the operation (as given by the getType function) will result in all existing saved workspaces no longer being loadable. Therefore, it is essential that appropriate names be chosen right from the beginning.
|
virtualdefault |
|
pure virtual |
Most subclasses will simply use the C++ new
operator to implement this function.
Implemented in TypedOperationFactory< T >.
|
pure virtual |
op | The operation to destroy. It must have been created by a call to create(). |
Calling this function essentially gives back ownership of the operation to the factory, but the expectation is that the operation will be deleted. Most subclasses will simply use the C++ delete
operator to implement this function.
Implemented in TypedOperationFactory< T >.
|
pure virtual |
A path may only include letters, numbers, underscores and spaces. The forward slash character (/) is used to separate levels in the catalogue, similar to how directories are separated in a path for file systems.
Unlike the type and module names, the catalogue path can be changed without affecting the loadability of existing workspaces. It is only used to help the user find it in user interfaces.
Implemented in TypedOperationFactory< T >, and TypedOperationFactory< T >.
|
pure virtual |
It is recommended that this path be a Qt resource path. Example: "images:/myoperation.png"
Implemented in TypedOperationFactory< T >, and TypedOperationFactory< T >.
|
pure virtual |
Implemented in TypedOperationFactory< T >.
QString getHeaderPath | ( | ) | const |
This function calls getRawHeaderPath() and modifies what it returns to form a more compact path. Typically this involves stripping off some portion of the start of an absolute path to leave a minimal path relative to either the top of the source tree or the directory above that. The result of getRawHeaderPath() will be returned unchanged if no leading part could be stripped off.
|
pure virtual |
Implemented in TypedOperationFactory< T >, and TypedOperationFactory< T >.
|
pure virtual |
Implemented in TypedOperationFactory< T >.
|
pure virtual |
Subclass implementors should not change the value returned by this function if it can be avoided, as doing so makes all existing saved workspaces no longer loadable.
Implemented in TypedOperationFactory< T >, and TypedOperationFactory< T >.
|
pure virtual |
Implemented in TypedOperationFactory< T >.
|
pure virtual |
Implemented in TypedOperationFactory< T >, and TypedOperationFactory< T >.