Mantid
Loading...
Searching...
No Matches
CatalogGetDataSets.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
13
14namespace Mantid::ICat {
15DECLARE_ALGORITHM(CatalogGetDataSets)
16
17
18void CatalogGetDataSets::init() {
19 declareProperty("InvestigationId", "", std::make_shared<Kernel::MandatoryValidator<std::string>>(),
20 "ID of the selected investigation");
21 declareProperty("Session", "", "The session information of the catalog to use.");
22 declareProperty(
23 std::make_unique<API::WorkspaceProperty<API::ITableWorkspace>>("OutputWorkspace", "", Kernel::Direction::Output),
24 "The name of the workspace to store the results.");
25}
26
29 auto workspace = API::WorkspaceFactory::Instance().createTable("TableWorkspace");
31 .getCatalog(getPropertyValue("Session"))
32 ->getDataSets(getProperty("InvestigationId"), workspace);
33 setProperty("OutputWorkspace", workspace);
34}
35} // namespace Mantid::ICat
#define DECLARE_ALGORITHM(classname)
Definition: Algorithm.h:576
IPeaksWorkspace_sptr workspace
Definition: IndexPeaks.cpp:114
std::string getPropertyValue(const std::string &name) const override
Get the value of a property as a string.
Definition: Algorithm.cpp:2026
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
Definition: Algorithm.cpp:2076
A property class for workspaces.
This algorithm obtains the datasets for a given investigation record using the related ID.
void exec() override
Overwrites Algorithm exec method.
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
Validator to check that a property is not left empty.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
@ Output
An output workspace.
Definition: Property.h:54