16#include <boost/python/class.hpp>
17#include <boost/python/overloads.hpp>
47 size_t NVectors =
size_t(-1),
size_t XLength =
size_t(-1),
48 size_t YLength =
size_t(-1)) {
49 return self->
create(parent, NVectors, XLength, YLength);
59BOOST_PYTHON_FUNCTION_OVERLOADS(createFromParent_Overload, createFromParentPtr, 2, 5)
60BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(createTable_Overload, createTable, 0, 1)
61BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(createPeaks_Overload, createPeaks, 0, 1)
68 const char *createFromParentDoc =
"Create a workspace based on the given "
69 "one. The meta-data, instrument etc are "
70 "copied from the input"
71 "If the size parameters are passed then "
72 "the workspace will be a different size.";
74 const char *createFromScratchDoc =
"Create a clean new worksapce of the given size.";
76 const size_t &,
const size_t &)
const;
78 class_<WorkspaceFactoryImpl, boost::noncopyable>(
"WorkspaceFactoryImpl", no_init)
79 .def(
"create", &createFromParentPtr,
80 createFromParent_Overload(createFromParentDoc, (arg(
"self"), arg(
"parent"), arg(
"NVectors") = -1,
81 arg(
"XLength") = -1, arg(
"YLength") = -1)))
85 (arg(
"self"), arg(
"className"), arg(
"NVectors"), arg(
"XLength"), arg(
"YLength")))
89 "Creates an empty TableWorkspace",
94 "Creates an empty PeaksWorkspace",
98 "Returns the single instance of this class.")
99 .staticmethod(
"Instance");
#define GET_POINTER_SPECIALIZATION(TYPE)
void export_WorkspaceFactory()
#define GNU_DIAG_OFF(x)
This is a collection of macros for turning compiler warnings off in a controlled manner.
The WorkspaceFactory class is in charge of the creation of all types of workspaces.
std::shared_ptr< ITableWorkspace > createTable(const std::string &className="TableWorkspace") const
Create a ITableWorkspace.
std::shared_ptr< IPeaksWorkspace > createPeaks(const std::string &className="PeaksWorkspace") const
Create a IPeaksWorkspace.
MatrixWorkspace_sptr create(const MatrixWorkspace_const_sptr &parent, size_t NVectors=size_t(-1), size_t XLength=size_t(-1), size_t YLength=size_t(-1)) const
Create a new instance of the same type of workspace as that given as argument.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
Implements the AsType policy.