Mantid
Loading...
Searching...
No Matches
FilteredTimeSeriesProperty.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 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 +
8#include "MantidKernel/DllConfig.h"
9#include <string>
10
11using namespace Mantid::Kernel;
12
13namespace Mantid::Kernel {
14
20template <typename HeldType>
22 const TimeSeriesProperty<bool> &filterProp)
23 : TimeSeriesProperty<HeldType>(*seriesProp),
24 m_unfiltered(std::unique_ptr<const TimeSeriesProperty<HeldType>>(seriesProp->clone())) {
25 // Now filter us with the filter
26 this->filterWith(&filterProp);
27}
28
35template <typename HeldType>
37 std::unique_ptr<const TimeSeriesProperty<HeldType>> seriesProp, const TimeSeriesProperty<bool> &filterProp)
38 : TimeSeriesProperty<HeldType>(*seriesProp), m_unfiltered(std::move(seriesProp)) {
39 // Now filter us with the filter
40 this->filterWith(&filterProp);
41}
42
46template <typename HeldType> FilteredTimeSeriesProperty<HeldType>::~FilteredTimeSeriesProperty() = default;
47
52template <typename HeldType>
54 return m_unfiltered.get();
55}
56
58// -------------------------- Macro to instantiation concrete types
59// --------------------------------
60#define INSTANTIATE(TYPE) template class MANTID_KERNEL_DLL FilteredTimeSeriesProperty<TYPE>;
61
62// -------------------------- Concrete instantiation
63// -----------------------------------------------
64INSTANTIATE(int32_t)
65INSTANTIATE(int64_t)
66INSTANTIATE(uint32_t)
67INSTANTIATE(uint64_t)
68INSTANTIATE(float)
69INSTANTIATE(double)
70INSTANTIATE(std::string)
71INSTANTIATE(bool)
72
73
74
75} // namespace Mantid::Kernel
#define INSTANTIATE(TYPE)
Definition: Statistics.cpp:403
FilteredTimeSeriesProperty()=delete
Disable default constructor.
const TimeSeriesProperty< HeldType > * unfiltered() const
Access the unfiltered log.
~FilteredTimeSeriesProperty() override
Destructor.
A specialised Property class for holding a series of time-value pairs.
void filterWith(const TimeSeriesProperty< bool > *filter)
Divide the property into allowed and disallowed time intervals according to filter.
STL namespace.