Mantid
Loading...
Searching...
No Matches
CatalogListInvestigationTypes.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 +
10
11namespace Mantid::ICat {
12DECLARE_ALGORITHM(CatalogListInvestigationTypes)
13
14
16 declareProperty("Session", "", "The session information of the catalog to use.");
17 declareProperty(std::make_unique<Kernel::ArrayProperty<std::string>>("InvestigationTypes", std::vector<std::string>(),
18 std::make_shared<Kernel::NullValidator>(),
20 "A list containing investigation types.");
21}
22
25 std::vector<std::string> investigationTypes;
26 API::CatalogManager::Instance().getCatalog(getPropertyValue("Session"))->listInvestigationTypes(investigationTypes);
27 setProperty("InvestigationTypes", investigationTypes);
28}
29} // namespace Mantid::ICat
#define DECLARE_ALGORITHM(classname)
Definition: Algorithm.h:576
std::string getPropertyValue(const std::string &name) const override
Get the value of a property as a string.
Definition: Algorithm.cpp:2026
This algorithm obtains a list of investigation types from the catalog.
void exec() override
Overwrites Algorithm exec method.
Support for a property that holds an array of values.
Definition: ArrayProperty.h:28
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
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