Workspace 6.21.5
Classes | Namespaces | Macros
operationfactorytraits.h File Reference
#include <QString>
#include "operationfactory.h"
Include dependency graph for operationfactorytraits.h:
This graph shows which files directly or indirectly include this file:

Classes

class  OperationFactoryTraits< T >
 Traits class for operations of type T. More...
 

Namespaces

namespace  CSIRO
 Top level namespace for all Workspace code.
 
namespace  CSIRO::Application
 Application-level functionality for all workspace applications.
 
namespace  CSIRO::DataExecution
 Base workspace functionality not requiring a user interface.
 

Macros

#define DECLARE_WORKSPACE_OPERATION_FACTORY(T, WORKSPACE_EXPORT_SYMBOL)
 

Macro Definition Documentation

◆ DECLARE_WORKSPACE_OPERATION_FACTORY

#define DECLARE_WORKSPACE_OPERATION_FACTORY (   T,
  WORKSPACE_EXPORT_SYMBOL 
)
Value:
namespace CSIRO \
{ \
namespace DataExecution \
{ \
template<> \
WORKSPACE_EXPORT_SYMBOL const OperationFactory& OperationFactoryTraits<T>::getInstance(); \
template<> \
WORKSPACE_EXPORT_SYMBOL \
T* \
OperationFactoryTraits<T>::create(); \
template<> \
{ \
return __FILE__; \
} \
} \
}
static const OperationFactory & getInstance()
Top level namespace for all Workspace code.
Definition: applicationsupportplugin.cpp:32

This macro is analogous to the DECLARE_WORKSPACE_DATA_FACTORY macro. See its detailed description for why we also need a similar macro for operation factories. Unlike for data factories, however, most of the OperationFactoryTraits member functions are actually defined in the class definition by implementing them in terms of getInstance() . The create() function could theoretically also be implemented this way, but we specialize that too with this macro so that the return type can be T instead of the OperationFactory base class.