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);
58BOOST_PYTHON_FUNCTION_OVERLOADS(createFromParent_Overload, createFromParentPtr, 2, 5)
67 const char *createFromParentDoc =
"Create a workspace based on the given "
68 "one. The meta-data, instrument etc are "
69 "copied from the input"
70 "If the size parameters are passed then "
71 "the workspace will be a different size.";
73 const char *createFromScratchDoc =
"Create a clean new worksapce of the given size.";
75 const size_t &,
const size_t &)
const;
77 class_<WorkspaceFactoryImpl, boost::noncopyable>(
"WorkspaceFactoryImpl", no_init)
78 .def(
"create", &createFromParentPtr,
79 createFromParent_Overload(createFromParentDoc, (arg(
"self"), arg(
"parent"), arg(
"NVectors") = -1,
80 arg(
"XLength") = -1, arg(
"YLength") = -1)))
84 (arg(
"self"), arg(
"className"), arg(
"NVectors"), arg(
"XLength"), arg(
"YLength")))
88 "Creates an empty TableWorkspace",
93 "Creates an empty PeaksWorkspace",
97 "Returns the single instance of this class.")
98 .staticmethod(
"Instance");
#define GET_POINTER_SPECIALIZATION(TYPE)
void export_WorkspaceFactory()
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(valueAsPrettyStrOverloader, valueAsPrettyStr, 0, 2) void export_Property()
#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.