##// END OF EJS Templates
Adapts iterator to be MoveAssignable...
Adapts iterator to be MoveAssignable This will be necessary for purge method (using std::remove_if())

File last commit:

r616:e4c0228e8d67
r627:07d26320a984
Show More
SqpRange.h
58 lines | 1.5 KiB | text/x-c | CLexer
Remplacement de SqpDateTime part SqpRange
r470 #ifndef SCIQLOP_SQPRANGE_H
#define SCIQLOP_SQPRANGE_H
Add SqpDateTime struct
r177
SqpDateTime is now declared as meta type
r218 #include <QObject>
Add qdebug operator for SqpDateTime to enable its display in a log
r274
#include <QDebug>
Alexandre Leroux
Uses DateUtils
r450 #include <Common/DateUtils.h>
Alexandre Leroux
Centralization of qregistermetatype management
r285 #include <Common/MetaTypes.h>
Alexandre Leroux
Fixes Linux compilation
r616 #include <cmath>
Add SqpDateTime struct
r177 /**
Remplacement de SqpDateTime part SqpRange
r470 * @brief The SqpRange struct holds the information of time parameters
Add SqpDateTime struct
r177 */
Remplacement de SqpDateTime part SqpRange
r470 struct SqpRange {
Alexandre Leroux
Some fixes...
r453 /// Start time (UTC)
Add SqpDateTime struct
r177 double m_TStart;
Alexandre Leroux
Some fixes...
r453 /// End time (UTC)
Add SqpDateTime struct
r177 double m_TEnd;
A variable is now created with its dateTime too....
r212
Remplacement de SqpDateTime part SqpRange
r470 bool contains(const SqpRange &dateTime) const noexcept
A variable is now created with its dateTime too....
r212 {
return (m_TStart <= dateTime.m_TStart && m_TEnd >= dateTime.m_TEnd);
}
Add intersect méthode on variable and sqpDateTime...
r240
Remplacement de SqpDateTime part SqpRange
r470 bool intersect(const SqpRange &dateTime) const noexcept
Add intersect méthode on variable and sqpDateTime...
r240 {
return (m_TEnd >= dateTime.m_TStart && m_TStart <= dateTime.m_TEnd);
}
Alexandre Leroux
Fixed untimely update of the range to be displayed in the variable widget
r611
bool operator==(const SqpRange &other) const
{
auto equals = [](const auto &v1, const auto &v2) {
return (std::isnan(v1) && std::isnan(v2)) || v1 == v2;
};
return equals(m_TStart, other.m_TStart) && equals(m_TEnd, other.m_TEnd);
}
bool operator!=(const SqpRange &other) const { return !(*this == other); }
Add SqpDateTime struct
r177 };
Alexandre Leroux
Fixed untimely update of the range to be displayed in the variable widget
r611 const auto INVALID_RANGE
= SqpRange{std::numeric_limits<double>::quiet_NaN(), std::numeric_limits<double>::quiet_NaN()};
Remplacement de SqpDateTime part SqpRange
r470 inline QDebug operator<<(QDebug d, SqpRange obj)
Add qdebug operator for SqpDateTime to enable its display in a log
r274 {
Alexandre Leroux
Uses DateUtils
r450 auto tendDateTimeStart = DateUtils::dateTime(obj.m_TStart);
auto tendDateTimeEnd = DateUtils::dateTime(obj.m_TEnd);
Add qdebug operator for SqpDateTime to enable its display in a log
r274
d << "ts: " << tendDateTimeStart << " te: " << tendDateTimeEnd;
return d;
}
SqpDateTime is now declared as meta type
r218 // Required for using shared_ptr in signals/slots
Remplacement de SqpDateTime part SqpRange
r470 SCIQLOP_REGISTER_META_TYPE(SQPRANGE_REGISTRY, SqpRange)
SqpDateTime is now declared as meta type
r218
Remplacement de SqpDateTime part SqpRange
r470 #endif // SCIQLOP_SQPRANGE_H