Mantid
Loading...
Searching...
No Matches
MDUnit.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2015 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
11#include <memory>
12#include <string>
13
14namespace Mantid {
15namespace Kernel {
16
20class MANTID_KERNEL_DLL MDUnit {
21public:
22 virtual UnitLabel getUnitLabel() const = 0;
23 virtual bool canConvertTo(const MDUnit &other) const = 0;
24 virtual bool isQUnit() const = 0;
25 virtual MDUnit *clone() const = 0;
26 bool operator==(const MDUnit &other) const;
27 virtual ~MDUnit() = default;
28};
29
31class MANTID_KERNEL_DLL QUnit : public MDUnit {
32public:
33 bool isQUnit() const override;
34};
35
37class MANTID_KERNEL_DLL ReciprocalLatticeUnit : public QUnit {
38public:
41 UnitLabel getUnitLabel() const override;
42 bool canConvertTo(const MDUnit &other) const override;
43 ReciprocalLatticeUnit *clone() const override;
44
45private:
46 bool isSpecialRLUUnitLabel() const;
48};
49
51class MANTID_KERNEL_DLL InverseAngstromsUnit : public QUnit {
52public:
53 UnitLabel getUnitLabel() const override;
54 bool canConvertTo(const MDUnit &other) const override;
55 InverseAngstromsUnit *clone() const override;
56};
57
58class MANTID_KERNEL_DLL LabelUnit : public MDUnit {
59private:
61
62public:
63 LabelUnit(UnitLabel unitLabel);
64 UnitLabel getUnitLabel() const override;
65 bool canConvertTo(const MDUnit &other) const override;
66 bool isQUnit() const override;
67 LabelUnit *clone() const override;
68};
69
70using MDUnit_uptr = std::unique_ptr<MDUnit>;
71using MDUnit_const_uptr = std::unique_ptr<const MDUnit>;
72
73} // namespace Kernel
74} // namespace Mantid
Inverse Angstroms unit.
Definition: MDUnit.h:51
UnitLabel m_unitLabel
Definition: MDUnit.h:60
MDUnit : Unit type for multidimensional data types.
Definition: MDUnit.h:20
virtual MDUnit * clone() const =0
virtual ~MDUnit()=default
virtual UnitLabel getUnitLabel() const =0
virtual bool canConvertTo(const MDUnit &other) const =0
virtual bool isQUnit() const =0
QUnit base.
Definition: MDUnit.h:31
A base-class for the a class that is able to return unit labels in different representations.
Definition: UnitLabel.h:20
std::unique_ptr< const MDUnit > MDUnit_const_uptr
Definition: MDUnit.h:71
std::unique_ptr< MDUnit > MDUnit_uptr
Definition: MDUnit.h:70
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)