Mantid
Loading...
Searching...
No Matches
CatalogMyDataSearch.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 +
11
12namespace Mantid::ICat {
13DECLARE_ALGORITHM(CatalogMyDataSearch)
14
15
16void CatalogMyDataSearch::init() {
17 declareProperty("Session", "", "The session information of the catalog to use.");
18 declareProperty(
19 std::make_unique<API::WorkspaceProperty<API::ITableWorkspace>>("OutputWorkspace", "", Kernel::Direction::Output),
20 "The name of the workspace to store the search results.");
21}
22
25 auto outputws = API::WorkspaceFactory::Instance().createTable("TableWorkspace");
26 API::CatalogManager::Instance().getCatalog(getPropertyValue("Session"))->myData(outputws);
27 setProperty("OutputWorkspace", outputws);
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
A property class for workspaces.
This algorithm obtains all of the information for the investigations the logged in user is an investi...
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.
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