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
17//-----------------------------------------------------------------------------
18// Forward declarations
19//-----------------------------------------------------------------------------
20namespace NeXus {
21class File;
22}
23
24namespace Mantid {
25namespace API {
26class IAlgorithm;
27class HistoryView;
28
35class MANTID_API_DLL WorkspaceHistory {
36public:
40 virtual ~WorkspaceHistory() = default;
47 const AlgorithmHistories &getAlgorithmHistories() const;
49 const Kernel::EnvironmentHistory &getEnvironmentHistory() const;
51 void addHistory(const WorkspaceHistory &otherHistory);
53 void addHistory(AlgorithmHistory_sptr algHistory);
55 size_t size() const;
57 bool empty() const;
59 void clearHistory();
61 AlgorithmHistory_const_sptr getAlgorithmHistory(const size_t index) const;
63 AlgorithmHistory_const_sptr operator[](const size_t index) const;
65 bool operator==(const WorkspaceHistory &otherHistory) const;
67 std::shared_ptr<IAlgorithm> getAlgorithm(const size_t index) const;
69 std::shared_ptr<IAlgorithm> lastAlgorithm() const;
71 std::shared_ptr<HistoryView> createView() const;
72
74 void printSelf(std::ostream &, const int indent = 0) const;
75
77 void saveNexus(::NeXus::File *file) const;
79 void loadNexus(::NeXus::File *file);
80
81private:
83 void loadNestedHistory(::NeXus::File *file,
84 const AlgorithmHistory_sptr &parent = std::shared_ptr<AlgorithmHistory>());
86 AlgorithmHistory_sptr parseAlgorithmHistory(const std::string &rawData);
88 std::set<int> findHistoryEntries(::NeXus::File *file);
93};
94
95MANTID_API_DLL std::ostream &operator<<(std::ostream &, const WorkspaceHistory &);
96
97} // namespace API
98} // namespace Mantid
std::map< DeltaEMode::Type, std::string > index
Definition: DeltaEMode.cpp:19
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)