Mantid
Loading...
Searching...
No Matches
TimeSplitter.h
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 +
7#pragma once
8
10
11namespace Mantid {
12namespace Kernel {
13
23class MANTID_KERNEL_DLL SplittingInterval {
24public:
27
28 SplittingInterval(const Types::Core::DateAndTime &start, const Types::Core::DateAndTime &stop, const int index = 0);
29
30 Types::Core::DateAndTime start() const;
31 Types::Core::DateAndTime stop() const;
32
33 double duration() const;
34
35 int index() const;
36
37 bool overlaps(const SplittingInterval &b) const;
42
43 bool operator<(const SplittingInterval &b) const;
44 bool operator>(const SplittingInterval &b) const;
45
46private:
48 Types::Core::DateAndTime m_start;
50 Types::Core::DateAndTime m_stop;
53};
54
60using TimeSplitterType = std::vector<SplittingInterval>;
61
62// -------------- Operators ---------------------
63MANTID_KERNEL_DLL TimeSplitterType operator+(const TimeSplitterType &a, const TimeSplitterType &b);
64MANTID_KERNEL_DLL TimeSplitterType operator&(const TimeSplitterType &a, const TimeSplitterType &b);
65MANTID_KERNEL_DLL TimeSplitterType operator|(const TimeSplitterType &a, const TimeSplitterType &b);
66MANTID_KERNEL_DLL TimeSplitterType operator~(const TimeSplitterType &a);
67
68} // Namespace Kernel
69} // Namespace Mantid
std::map< DeltaEMode::Type, std::string > index
Definition: DeltaEMode.cpp:19
Class holding a start/end time and a destination for splitting event lists and logs.
Definition: TimeSplitter.h:23
Types::Core::DateAndTime m_stop
end
Definition: TimeSplitter.h:50
int m_index
Index of the destination.
Definition: TimeSplitter.h:52
Types::Core::DateAndTime m_start
begin
Definition: TimeSplitter.h:48
MANTID_KERNEL_DLL TimeSplitterType operator&(const TimeSplitterType &a, const TimeSplitterType &b)
AND operator for TimeSplitterType Works on Filters - combines them to only keep times where both Filt...
std::vector< SplittingInterval > TimeSplitterType
A typedef for splitting events according their pulse time.
Definition: LogManager.h:31
MANTID_KERNEL_DLL TimeSplitterType operator~(const TimeSplitterType &a)
NOT operator for TimeSplitterType Only works on Filters.
MANTID_KERNEL_DLL TimeSplitterType operator|(const TimeSplitterType &a, const TimeSplitterType &b)
OR operator for TimeSplitterType Only works on Filters, not splitters.
MANTID_KERNEL_DLL TimeSplitterType operator+(const TimeSplitterType &a, const TimeSplitterType &b)
Plus operator for TimeSplitterType.
Helper class which provides the Collimation Length for SANS instruments.
std::common_type_t< wide_integer< Bits, Signed >, wide_integer< Bits2, Signed2 > > constexpr operator|(const wide_integer< Bits, Signed > &lhs, const wide_integer< Bits2, Signed2 > &rhs)
constexpr bool operator>(const wide_integer< Bits, Signed > &lhs, const wide_integer< Bits2, Signed2 > &rhs)
constexpr bool operator<(const wide_integer< Bits, Signed > &lhs, const wide_integer< Bits2, Signed2 > &rhs)
std::common_type_t< wide_integer< Bits, Signed >, wide_integer< Bits2, Signed2 > > constexpr operator&(const wide_integer< Bits, Signed > &lhs, const wide_integer< Bits2, Signed2 > &rhs)