forked from AmbaPant/mantid
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Frequencies.h
67 lines (60 loc) · 2.78 KB
/
Frequencies.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2016 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 +
#pragma once
#include "MantidHistogramData/Addable.h"
#include "MantidHistogramData/DllConfig.h"
#include "MantidHistogramData/HistogramY.h"
#include "MantidHistogramData/Iterable.h"
#include "MantidHistogramData/Offsetable.h"
#include "MantidHistogramData/Scalable.h"
#include "MantidHistogramData/VectorOf.h"
namespace Mantid {
namespace HistogramData {
class BinEdges;
class Counts;
/** Frequencies
Container for the frequencies in a histogram. A copy-on-write mechanism saves
memory and makes copying cheap. The implementation is based on
detail::VectorOf, a wrapper around a cow_ptr. Mixins such as detail::Iterable
provide iterators and other operations.
@author Simon Heybrock
@date 2016
*/
class MANTID_HISTOGRAMDATA_DLL Frequencies : public detail::VectorOf<Frequencies, HistogramY>,
public detail::Addable<Frequencies>,
public detail::Iterable<Frequencies>,
public detail::Offsetable<Frequencies>,
public detail::Scalable<Frequencies> {
public:
using VectorOf<Frequencies, HistogramY>::VectorOf;
using VectorOf<Frequencies, HistogramY>::operator=;
// Multiple inheritance causes ambiguous overload, bring operators into scope.
using detail::Addable<Frequencies>::operator+;
using detail::Addable<Frequencies>::operator+=;
using detail::Addable<Frequencies>::operator-;
using detail::Addable<Frequencies>::operator-=;
using detail::Offsetable<Frequencies>::operator+;
using detail::Offsetable<Frequencies>::operator+=;
using detail::Offsetable<Frequencies>::operator-;
using detail::Offsetable<Frequencies>::operator-=;
/// Default constructor, creates a NULL object.
Frequencies() = default;
// The copy and move constructor and assignment are not captured properly by
// the using declaration above, so we need them here explicitly.
/// Copy constructor. Lightweight, internal data will be shared.
Frequencies(const Frequencies &) = default;
/// Move constructor.
Frequencies(Frequencies &&) = default;
/// Copy assignment. Lightweight, internal data will be shared.
Frequencies &operator=(const Frequencies &) & = default;
/// Move assignment.
Frequencies &operator=(Frequencies &&) & = default;
Frequencies(const Counts &counts, const BinEdges &edges);
Frequencies(Counts &&counts, const BinEdges &edges);
};
} // namespace HistogramData
} // namespace Mantid