##// END OF EJS Templates
Remplacement de SqpDateTime part SqpRange
perrinel -
r511:57de5678b1b3
parent child
Show More
@@ -1,5 +1,5
1 #ifndef SCIQLOP_SQPDATETIME_H
2 #define SCIQLOP_SQPDATETIME_H
1 #ifndef SCIQLOP_SQPRANGE_H
2 #define SCIQLOP_SQPRANGE_H
3 3
4 4 #include <QObject>
5 5
@@ -9,26 +9,26
9 9 #include <Common/MetaTypes.h>
10 10
11 11 /**
12 * @brief The SqpDateTime struct holds the information of time parameters
12 * @brief The SqpRange struct holds the information of time parameters
13 13 */
14 struct SqpDateTime {
14 struct SqpRange {
15 15 /// Start time (UTC)
16 16 double m_TStart;
17 17 /// End time (UTC)
18 18 double m_TEnd;
19 19
20 bool contains(const SqpDateTime &dateTime) const noexcept
20 bool contains(const SqpRange &dateTime) const noexcept
21 21 {
22 22 return (m_TStart <= dateTime.m_TStart && m_TEnd >= dateTime.m_TEnd);
23 23 }
24 24
25 bool intersect(const SqpDateTime &dateTime) const noexcept
25 bool intersect(const SqpRange &dateTime) const noexcept
26 26 {
27 27 return (m_TEnd >= dateTime.m_TStart && m_TStart <= dateTime.m_TEnd);
28 28 }
29 29 };
30 30
31 inline QDebug operator<<(QDebug d, SqpDateTime obj)
31 inline QDebug operator<<(QDebug d, SqpRange obj)
32 32 {
33 33 auto tendDateTimeStart = DateUtils::dateTime(obj.m_TStart);
34 34 auto tendDateTimeEnd = DateUtils::dateTime(obj.m_TEnd);
@@ -38,6 +38,6 inline QDebug operator<<(QDebug d, SqpDateTime obj)
38 38 }
39 39
40 40 // Required for using shared_ptr in signals/slots
41 SCIQLOP_REGISTER_META_TYPE(SQPDATETIME_REGISTRY, SqpDateTime)
41 SCIQLOP_REGISTER_META_TYPE(SQPRANGE_REGISTRY, SqpRange)
42 42
43 #endif // SCIQLOP_SQPDATETIME_H
43 #endif // SCIQLOP_SQPRANGE_H
General Comments 0
You need to be logged in to leave comments. Login now