From 515dfaf35cec841c7f51c43ea0fe6e147205d0a6 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Fri, 27 Sep 2024 13:41:30 +0200 Subject: [PATCH] reprogrammed to use ATBTime class --- library/include/mobilisis/time_range.h | 51 ++++++++++++++++++++------ 1 file changed, 39 insertions(+), 12 deletions(-) diff --git a/library/include/mobilisis/time_range.h b/library/include/mobilisis/time_range.h index 5abd9c1..57493dd 100644 --- a/library/include/mobilisis/time_range.h +++ b/library/include/mobilisis/time_range.h @@ -1,12 +1,39 @@ -#ifndef TIME_RANGE_H_INCLUDED -#define TIME_RANGE_H_INCLUDED - -#include "time_range_header.h" - -struct TimeRange { -public: - bool IsActive; - ATBTimeRange TimeRangeStructure; -}; - -#endif // TIME_RANGE_H_INCLUDED +#ifndef TIME_RANGE_H_INCLUDED +#define TIME_RANGE_H_INCLUDED + +#include "atb_time.h" + +#include + +struct TimeRange { + ATBTime m_start; + ATBTime m_end; + int m_duration; + + explicit TimeRange() = default; + explicit TimeRange(QString const &start, QString const &end, int duration) + : m_start(start) + , m_end(end) + , m_duration(duration) { + } + explicit TimeRange(ATBTime const &start, ATBTime const &end, int duration) + : m_start(start) + , m_end(end) + , m_duration(duration) { + } + + explicit TimeRange(TimeRange const &timeRange) { + m_start = timeRange.m_start; + m_end = timeRange.m_end; + m_duration = timeRange.m_duration; + } + + TimeRange &operator=(TimeRange && timeRange) { + m_start = std::move(timeRange.m_start); + m_end = std::move(timeRange.m_end); + m_duration = timeRange.m_duration; + return *this; + } +}; + +#endif // TIME_RANGE_H_INCLUDED