-
Notifications
You must be signed in to change notification settings - Fork 122
/
RemoveWorkspaceHistory.cpp
47 lines (37 loc) · 1.69 KB
/
RemoveWorkspaceHistory.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#include "MantidAlgorithms/RemoveWorkspaceHistory.h"
#include "MantidAPI/Workspace.h"
#include "MantidAPI/WorkspaceHistory.h"
using namespace Mantid::Kernel;
using namespace Mantid::API;
namespace Mantid::Algorithms {
// Register the algorithm into the AlgorithmFactory
DECLARE_ALGORITHM(RemoveWorkspaceHistory)
/// Algorithm's name for identification. @see Algorithm::name
const std::string RemoveWorkspaceHistory::name() const { return "RemoveWorkspaceHistory"; }
/// Algorithm's version for identification. @see Algorithm::version
int RemoveWorkspaceHistory::version() const { return 1; }
/// Algorithm's category for identification. @see Algorithm::category
const std::string RemoveWorkspaceHistory::category() const { return "Utility\\Workspaces"; }
/// Algorithm's summary for identification. @see Algorithm::summary
const std::string RemoveWorkspaceHistory::summary() const {
return "Removes all algorithm history records from a given workspace.";
}
/** Initialize the algorithm's properties.
*/
void RemoveWorkspaceHistory::init() {
declareProperty(std::make_unique<WorkspaceProperty<Workspace>>("Workspace", "", Direction::InOut),
"Workspace to remove the algorithm history from.");
}
/** Execute the algorithm.
*/
void RemoveWorkspaceHistory::exec() {
Workspace_sptr ws = getProperty("Workspace");
ws->history().clearHistory();
}
} // namespace Mantid::Algorithms