Mantid
Loading...
Searching...
No Matches
WorkspaceHistory.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2007 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 +
7#pragma once
8
9//----------------------------------------------------------------------
10// Includes
11//----------------------------------------------------------------------
14#include <ctime>
15#include <set>
16
17namespace Mantid {
18namespace API {
19class IAlgorithm;
20class HistoryView;
21
28class MANTID_API_DLL WorkspaceHistory {
29public:
33 virtual ~WorkspaceHistory() = default;
40 const AlgorithmHistories &getAlgorithmHistories() const;
42 const Kernel::EnvironmentHistory &getEnvironmentHistory() const;
44 void addHistory(const WorkspaceHistory &otherHistory);
46 void addHistory(AlgorithmHistory_sptr algHistory);
48 size_t size() const;
50 bool empty() const;
52 void clearHistory();
54 AlgorithmHistory_const_sptr getAlgorithmHistory(const size_t index) const;
56 AlgorithmHistory_const_sptr operator[](const size_t index) const;
58 bool operator==(const WorkspaceHistory &otherHistory) const;
60 std::shared_ptr<IAlgorithm> getAlgorithm(const size_t index) const;
62 std::shared_ptr<IAlgorithm> lastAlgorithm() const;
64 std::shared_ptr<HistoryView> createView() const;
65
67 void printSelf(std::ostream &, const int indent = 0) const;
68
70 void saveNexus(Nexus::File *file) const;
72 void loadNexus(Nexus::File *file);
73
74private:
76 void loadNestedHistory(Nexus::File *file, const AlgorithmHistory_sptr &parent = std::shared_ptr<AlgorithmHistory>());
78 AlgorithmHistory_sptr parseAlgorithmHistory(const std::string &rawData);
80 std::set<int> findHistoryEntries(Nexus::File const *file);
85};
86
87MANTID_API_DLL std::ostream &operator<<(std::ostream &, const WorkspaceHistory &);
88
89} // namespace API
90} // namespace Mantid
std::map< DeltaEMode::Type, std::string > index
This class stores information about the Workspace History used by algorithms on a workspace and the e...
virtual ~WorkspaceHistory()=default
Destructor.
Mantid::API::AlgorithmHistories m_algorithms
The algorithms which have been called on the workspace.
WorkspaceHistory(const WorkspaceHistory &)=default
Copy constructor.
WorkspaceHistory & operator=(const WorkspaceHistory &)=delete
Deleted copy assignment operator since m_environment has no copy assignment.
const Kernel::EnvironmentHistory m_environment
The environment of the workspace.
This class stores information about the Environment of the computer used by the framework.
std::vector< AlgorithmHistory_sptr > AlgorithmHistories
MANTID_API_DLL std::ostream & operator<<(std::ostream &, const AlgorithmHistory &)
Prints a text representation.
std::shared_ptr< const AlgorithmHistory > AlgorithmHistory_const_sptr
std::shared_ptr< AlgorithmHistory > AlgorithmHistory_sptr
Helper class which provides the Collimation Length for SANS instruments.
constexpr bool operator==(const wide_integer< Bits, Signed > &lhs, const wide_integer< Bits2, Signed2 > &rhs)