Workspace 6.21.5
|
Traits class for operations of type T. More...
#include <Workspace/DataExecution/Operations/operationfactorytraits.h>
Public Member Functions | |
CSIRO_EXPORTSPEC ChartToImage * | create () |
CSIRO_WORKSPACE_API CSIRO::DataExecution::Workspace * | create () |
CSIRO_EXPORTSPEC const OperationFactory & | getInstance () |
CSIRO_WORKSPACE_API const OperationFactory & | getInstance () |
QString | getRawHeaderPath () const |
QString | getRawHeaderPath () const |
Static Public Member Functions | |
static T * | create () |
static void | destroy (T *op) |
static QString | getCataloguePath () |
static const OperationFactory & | getInstance () |
static const Application::WorkspacePlugin & | getPlugin () |
static QString | getType () |
static constexpr bool | isWorkspaceType () |
In order to ensure that operation factories used across plugins are portable (ie will work on all platforms), there are cases where the code must prevent the compiler from having the chance to inline certain functions. In particular, the TypedOperationFactory template implements some memory allocation and deallocation, and this must not be allowed to get inlined or else memory could be allocated in one module and deallocated in another, and that is not portable. Therefore, the OperationFactoryTraits class provides an interface to the TypedOperationFactory functions but in a way that hides its implementation. The factory is ultimately instantiated by the DEFINE_WORKSPACE_OPERATION_FACTORY macro and the client code instantiates the OperationFactoryTraits class whenever it is needed. The macro defines the functions that are only declared in the OperationFactoryTraits class, and by only using the macro in an implementation file and never a header, the two classes are effectively decoupled and client code never sees the implementation of TypedOperationFactory.
CSIRO_EXPORTSPEC ChartToImage * create | ( | ) |
|
static |
Conceptually similar to the C++ new
operator.
CSIRO_WORKSPACE_API CSIRO::DataExecution::Workspace * create | ( | ) |
|
inlinestatic |
op | An operation assumed to be of type T that is also assumed to have been created by a call to create(). |
Deletes op. Conceptually similar to the C++ delete
operator.
|
inlinestatic |
CSIRO_EXPORTSPEC const OperationFactory & getInstance | ( | ) |
|
static |
CSIRO_WORKSPACE_API const OperationFactory & getInstance | ( | ) |
|
inlinestatic |
QString getRawHeaderPath | ( | ) | const |
|
inline |
|
inlinestatic |
|
inlinestaticconstexpr |