9#include <boost/date_time/date.hpp>
10#include <boost/date_time/time.hpp>
21using namespace Types::Core;
32 const DateAndTime fromObj(from);
33 const DateAndTime toObj(to);
43 const auto &thisBegin = this->
start();
44 const auto &thisEnd = this->
stop();
45 const auto &otherBegin = other->start();
46 const auto &otherEnd = other->stop();
48 return ((otherBegin < thisEnd) && (otherBegin >= thisBegin)) || ((otherEnd < thisEnd) && (otherEnd >= thisBegin)) ||
49 ((thisBegin < otherEnd) && (thisBegin >= otherBegin)) || ((thisEnd < otherEnd) && (thisEnd >= otherBegin));
64 const auto t2 = std::min(
stop(), ti.
stop());
99 s << t.
start().toSimpleString() <<
" - " << t.
stop().toSimpleString();
Represents a time interval.
TimeInterval()
Default constructor.
const Types::Core::DateAndTime & start() const
Beginning of the interval.
bool overlaps(const TimeInterval *other) const
Return true if the SplittingInterval overlaps with this one.
bool isValid() const
True if the interval is not empty.
Types::Core::DateAndTime m_stop
end
const Types::Core::DateAndTime & stop() const
End of the interval.
bool operator>(const TimeInterval &ti) const
bool operator==(const TimeInterval &ti) const
TimeInterval intersection(const TimeInterval &ti) const
Returns an intersection of two intervals.
double duration() const
in seconds
bool operator<(const TimeInterval &ti) const
Returns true if this interval ends before ti starts.
Types::Core::time_duration length() const
Interval length (in seconds?)
Types::Core::DateAndTime m_start
begin
std::string end_str() const
String representation of the end time.
std::string begin_str() const
String representation of the begin time.
MANTID_KERNEL_DLL std::ostream & operator<<(std::ostream &, CPUTimer &)
Convenience function to provide for easier debug printing.
Helper class which provides the Collimation Length for SANS instruments.