Workspace 6.21.5
Public Member Functions | List of all members
TypedOperationFactory< T > Class Template Reference

Operation factory class template. More...

#include <Workspace/DataExecution/Operations/typedoperationfactory.h>

Inheritance diagram for TypedOperationFactory< T >:
[legend]

Public Member Functions

T * create () const override
 
void destroy (Operation *op) const override
 
QString getCataloguePath () const
 
QString getCataloguePath () const override
 
QString getDefaultIconPath () const
 
QString getDefaultIconPath () const override
 
QString getDeprecationMessage () const override
 
const Application::WorkspacePlugingetPlugin () const
 
const Application::WorkspacePlugingetPlugin () const override
 
QString getSourceTreeTop () const override
 
QString getType () const
 
QString getType () const override
 
bool isDeprecated () const override
 
bool isWorkspaceType () const
 
bool isWorkspaceType () const override
 
- Public Member Functions inherited from OperationFactory
virtual ~OperationFactory ()=default
 
virtual Operationcreate () 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::WorkspacePlugingetPlugin () const =0
 
virtual QString getSourceTreeTop () const =0
 
virtual QString getType () const =0
 
virtual bool isDeprecated () const =0
 
virtual bool isWorkspaceType () const =0
 

Detailed Description

template<typename T>
class CSIRO::DataExecution::TypedOperationFactory< T >

Client code should never refer to this class directly. It should always use the OperationFactoryTraits class instead. The OperationFactoryTraits member function are usually sufficient, or access to this factory can be obtained via the OperationFactoryTraits::getInstance() function which returns a pointer to the base class of the factory.

Member Function Documentation

◆ create()

T * create ( ) const
inlineoverridevirtual

The default implementation creates a new T using T's default constructor. If T does not have a default constructor, you will need to provide your own explicit specialization of TypedOperationFactory::create().

Returns
A pointer to a new Operation of type T.
See also
destroy()

Implements OperationFactory.

◆ destroy()

void destroy ( Operation op) const
inlineoverridevirtual
Parameters
opThe Operation to be destroyed.

The default implementation uses operator delete to destroy op. If you provided your own create() function, then ensure that the destroy() function you also provided is consistent with how you create T objects. In general, this means if you create them with operator new, then you should delete them with operator delete.

This implementation also performs a check that op is of the expected operation type by comparing the factory returned from the operation's getFactory() function with this factory. If the compilation has debugging enabled, an assertion will be triggered, otherwise the call is forwarded to op's factory instead.

See also
create()

Implements OperationFactory.

◆ getCataloguePath() [1/2]

QString getCataloguePath ( ) const
virtual
Returns
A path indicating where the operation should appear in the catalogue hierarchy. This is case-sensitive.

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.

Implements OperationFactory.

◆ getCataloguePath() [2/2]

QString getCataloguePath ( ) const
overridevirtual
Returns
A path indicating where the operation should appear in the catalogue hierarchy. This is case-sensitive.

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.

Implements OperationFactory.

◆ getDefaultIconPath() [1/2]

QString getDefaultIconPath ( ) const
virtual
Returns
The file or resource location of the default icon for operations created by this factory.

It is recommended that this path be a Qt resource path. Example: "images:/myoperation.png"

Implements OperationFactory.

◆ getDefaultIconPath() [2/2]

QString getDefaultIconPath ( ) const
overridevirtual
Returns
The file or resource location of the default icon for operations created by this factory.

It is recommended that this path be a Qt resource path. Example: "images:/myoperation.png"

Implements OperationFactory.

◆ getDeprecationMessage()

QString getDeprecationMessage ( ) const
inlineoverridevirtual
Returns
If this operation is deprecated, a string containing the message to display (usually a reason for this operation being deprecated, plus the name of its replacement, if one exists). If the operation is not deprecated, an empty string will be returned.

Implements OperationFactory.

◆ getPlugin() [1/2]

const Application::WorkspacePlugin & getPlugin ( ) const
virtual
Returns
The WorkspacePlugin instance which provides this operation factory.

Implements OperationFactory.

◆ getPlugin() [2/2]

const Application::WorkspacePlugin & getPlugin ( ) const
overridevirtual
Returns
The WorkspacePlugin instance which provides this operation factory.

Implements OperationFactory.

◆ getSourceTreeTop()

QString getSourceTreeTop ( ) const
inlineoverridevirtual

Implements OperationFactory.

◆ getType() [1/2]

QString getType ( ) const
virtual
Returns
A name identifying the type of operation created by this factory. It must be unique among all operations supplied by this plugin. This is case-sensitive.

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.

See also
getPlugin()

Implements OperationFactory.

◆ getType() [2/2]

QString getType ( ) const
overridevirtual
Returns
A name identifying the type of operation created by this factory. It must be unique among all operations supplied by this plugin. This is case-sensitive.

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.

See also
getPlugin()

Implements OperationFactory.

◆ isDeprecated()

bool isDeprecated ( ) const
inlineoverridevirtual
Returns
True if this operation is deprecated and should be avoided in future workflows. False otherwise.
See also
getDeprecationMessage

Implements OperationFactory.

◆ isWorkspaceType() [1/2]

bool isWorkspaceType ( ) const
virtual
Returns
True if the operation is a workspace type (i.e. a type that derives from the Workspace class and should be treated in workflows as a specialised type of nested workflow).

Implements OperationFactory.

◆ isWorkspaceType() [2/2]

bool isWorkspaceType ( ) const
overridevirtual
Returns
True if the operation is a workspace type (i.e. a type that derives from the Workspace class and should be treated in workflows as a specialised type of nested workflow).

Implements OperationFactory.