Workspace 6.21.5
|
#include <QString>
#include "Workspace/Application/LanguageUtils/errorchecks.h"
#include "Workspace/Application/workspaceplugin.h"
#include "Workspace/api_workspace.h"
#include "operation.h"
#include "operationfactory.h"
#include "operationfactorytraits.h"
Classes | |
class | TypedOperationFactory< T > |
Operation factory class template. More... | |
Namespaces | |
namespace | CSIRO |
Top level namespace for all Workspace code. | |
namespace | CSIRO::DataExecution |
Base workspace functionality not requiring a user interface. | |
Macros | |
#define | CSIRO_TYPEDOPERATIONFACTORY_STRINGIFY(x) #x |
#define | CSIRO_TYPEDOPERATIONFACTORY_TOSTRING(x) CSIRO_TYPEDOPERATIONFACTORY_STRINGIFY(x) |
#define | DEFINE_WORKSPACE_OPERATION_FACTORY(T, P, C) DEFINE_WORKSPACE_OPERATION_FACTORY_NAMED(T, P, C, #T) |
#define | DEFINE_WORKSPACE_OPERATION_FACTORY_NAMED(T, P, C, N) DEFINE_WORKSPACE_OPERATION_FACTORY_NAMED_WITH_ICON(T, P, C, N, (P.getDefaultIconPath())) |
#define | DEFINE_WORKSPACE_OPERATION_FACTORY_NAMED_WITH_ICON(T, P, C, N, I) |
#define | DEFINE_WORKSPACE_OPERATION_FACTORY_WITH_ICON(T, P, C, I) DEFINE_WORKSPACE_OPERATION_FACTORY_NAMED_WITH_ICON(T, P, C, #T, I) |
#define | DEPRECATE_WORKSPACE_OPERATION(T, M) |
#define CSIRO_TYPEDOPERATIONFACTORY_TOSTRING | ( | x | ) | CSIRO_TYPEDOPERATIONFACTORY_STRINGIFY(x) |
#define DEFINE_WORKSPACE_OPERATION_FACTORY | ( | T, | |
P, | |||
C | |||
) | DEFINE_WORKSPACE_OPERATION_FACTORY_NAMED(T, P, C, #T) |
T | The Operation to define a factory for. It can have scope qualification if required, but that will show up as part of the name. Either employ a using declaration to make the scoping unnecessary or else use the DEFINE_WORKSPACE_OPERATION_FACTORY_NAMED macro. |
P | A reference to the WorkspacePlugin instance this Operation belongs to. See OperationFactory::getPlugin() for more details. |
C | The catalogue path for the Operation. See OperationFactory::getCataloguePath() for more details. |
Simply forwards to DEFINE_WORKSPACE_OPERATION_FACTORY_NAMED with the N parameter set to T in string form and the Im parameter set to an empty string.
#define DEFINE_WORKSPACE_OPERATION_FACTORY_NAMED | ( | T, | |
P, | |||
C, | |||
N | |||
) | DEFINE_WORKSPACE_OPERATION_FACTORY_NAMED_WITH_ICON(T, P, C, N, (P.getDefaultIconPath())) |
T | The Operation to define a factory for. It can have scope qualification if required. |
P | A reference to the WorkspacePlugin instance this Operation belongs to. See OperationFactory::getPlugin() for more details. |
C | The catalogue path for the Operation. See OperationFactory::getCataloguePath() for more details. |
N | The name to use for the Operation T. This will be seen by users and will also be used to uniquely identify the Operation within the specified plugin, P. See OperationFactory::getType() for more details. |
Simply forwards to DEFINE_WORKSPACE_OPERATION_FACTORY_NAMED_WITH_ICON, defaulting the value for I to the path to the default Operation icon image.
#define DEFINE_WORKSPACE_OPERATION_FACTORY_NAMED_WITH_ICON | ( | T, | |
P, | |||
C, | |||
N, | |||
I | |||
) |
T | The Operation to define a factory for. It can have scope qualification if required. |
P | A reference to the WorkspacePlugin instance this Operation belongs to. See OperationFactory::getPlugin() for more details. |
C | The catalogue path for the Operation. See OperationFactory::getCataloguePath() for more details. |
N | The name to use for the Operation T. This will be seen by users and will also be used to uniquely identify the Operation within the specified plugin, P. See OperationFactory::getType() for more details. |
I | The resource path to the icon to use for all Operations of type T. This should be either an absolute path to an image, or a Qt resource path to an image. |
This macro defines the explicit specializations of the functions in OperationFactoryTraits for the type T. They are defined as forwarding functions to their corresponding equivalents in TypedOperationFactory<T>. This technique ensures that the function implementations for OperationFactoryTraits are only ever defined in the one place. Specifically, it ensures that T operations are always allocated and deleted in the same file when performed through the OperationFactoryTraits class.
The macro also takes care of explicitly instantiating TypedOperationFactory<T>.
#define DEFINE_WORKSPACE_OPERATION_FACTORY_WITH_ICON | ( | T, | |
P, | |||
C, | |||
I | |||
) | DEFINE_WORKSPACE_OPERATION_FACTORY_NAMED_WITH_ICON(T, P, C, #T, I) |
T | The Operation to define a factory for. It can have scope qualification if required. |
P | A reference to the WorkspacePlugin instance this Operation belongs to. See OperationFactory::getPlugin() for more details. |
C | The catalogue path for the Operation. See OperationFactory::getCataloguePath() for more details. |
I | The resource path to the icon to use for all Operations of type T. This should be either an absolute path to an image, or a Qt resource path to an image. |
Simply forwards to DEFINE_WORKSPACE_OPERATION_FACTORY_NAMED_WITH_ICON, defaulting the value for N to the same name as the operation.
#define DEPRECATE_WORKSPACE_OPERATION | ( | T, | |
M | |||
) |
T | The type of Operation to deprecate. |
M | The deprecation message to show when the operation is instantiated. This should be of type QString and already wrapped in a tr() invocation. |
Place this before the operation's DEFINE_WORKSPACE_OPERATION macro invocation to mark the operation as deprecated. Example usage from countedloop.cpp:
DEPRECATE_WORKSPACE_OPERATION(CountedLoop, Operation::tr("CountedLoop has been replaced by ForLoop. Use of CountedLoop in new workflows is not recommended.")); DEFINE_WORKSPACE_OPERATION_FACTORY_WITH_ICON(CountedLoop, BuiltinPlugin::getInstance(), Operation::tr("Builtin/Loops"), "images:/Workspace/operations/loop.png")