SqpDateTime.h
28 lines
| 653 B
| text/x-c
|
CLexer
r177 | #ifndef SCIQLOP_SQPDATETIME_H | |||
#define SCIQLOP_SQPDATETIME_H | ||||
r218 | #include <QObject> | |||
r177 | /** | |||
* @brief The SqpDateTime struct holds the information of time parameters | ||||
*/ | ||||
struct SqpDateTime { | ||||
/// Start time | ||||
double m_TStart; | ||||
/// End time | ||||
double m_TEnd; | ||||
r212 | ||||
bool contains(const SqpDateTime &dateTime) | ||||
{ | ||||
return (m_TStart <= dateTime.m_TStart && m_TEnd >= dateTime.m_TEnd); | ||||
} | ||||
r240 | ||||
bool intersect(const SqpDateTime &dateTime) | ||||
{ | ||||
return (m_TEnd >= dateTime.m_TStart && m_TStart <= dateTime.m_TEnd); | ||||
} | ||||
r177 | }; | |||
r218 | // Required for using shared_ptr in signals/slots | |||
Q_DECLARE_METATYPE(SqpDateTime) | ||||
r177 | #endif // SCIQLOP_SQPDATETIME_H | |||