forked from npshub/mantid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MementoTableWorkspace.h
49 lines (38 loc) · 1.76 KB
/
MementoTableWorkspace.h
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
48
49
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2011 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 "MantidAPI/Column.h"
#include "MantidDataObjects/TableWorkspace.h"
namespace Mantid {
namespace DataObjects {
/** @class MementoTableWorkspace
Variation on the TableWorkspace with a set of pre-defined columns used to
store diffs on Workspaces.
@author Owen Arnold
@date 31/08/2011
*/
class DLLExport MementoTableWorkspace : public TableWorkspace {
public:
MementoTableWorkspace &operator=(const MementoTableWorkspace &) = delete;
static bool isMementoWorkspace(const Mantid::API::ITableWorkspace &candidate);
MementoTableWorkspace(int nRows = 0);
/// Returns a clone of the workspace
std::unique_ptr<MementoTableWorkspace> clone() const { return std::unique_ptr<MementoTableWorkspace>(doClone()); }
/// Returns a default-initialized clone of the workspace
std::unique_ptr<MementoTableWorkspace> cloneEmpty() const {
return std::unique_ptr<MementoTableWorkspace>(doCloneEmpty());
}
protected:
/// Protected copy constructor. May be used by childs for cloning.
MementoTableWorkspace(const MementoTableWorkspace &) = default;
private:
MementoTableWorkspace *doClone() const override { return new MementoTableWorkspace(*this); }
MementoTableWorkspace *doCloneEmpty() const override { return new MementoTableWorkspace(); }
static bool expectedColumn(const Mantid::API::Column_const_sptr &expected,
const Mantid::API::Column_const_sptr &candidate);
};
} // namespace DataObjects
} // namespace Mantid