2016-03-15 21:52:31 +00:00
|
|
|
#pragma once
|
|
|
|
#include "centiseconds.h"
|
|
|
|
|
2016-03-28 18:25:11 +00:00
|
|
|
class TimeRange {
|
2016-03-15 21:52:31 +00:00
|
|
|
public:
|
2016-04-04 18:10:28 +00:00
|
|
|
using time_type = centiseconds;
|
2016-03-15 21:52:31 +00:00
|
|
|
|
2016-04-04 18:10:28 +00:00
|
|
|
TimeRange(time_type start, time_type end);
|
|
|
|
TimeRange(const TimeRange&) = default;
|
|
|
|
TimeRange(TimeRange&&) = default;
|
|
|
|
|
|
|
|
TimeRange& operator=(const TimeRange&) = default;
|
|
|
|
TimeRange& operator=(TimeRange&&) = default;
|
|
|
|
|
|
|
|
time_type getStart() const;
|
|
|
|
time_type getEnd() const;
|
|
|
|
time_type getLength() const;
|
|
|
|
|
|
|
|
void resize(const TimeRange& newRange);
|
|
|
|
void resize(time_type start, time_type end);
|
2016-04-19 20:06:20 +00:00
|
|
|
void shift(time_type offset);
|
|
|
|
void grow(time_type value);
|
|
|
|
void shrink(time_type value);
|
2016-04-04 18:10:28 +00:00
|
|
|
|
|
|
|
bool operator==(const TimeRange& rhs) const;
|
|
|
|
bool operator!=(const TimeRange& rhs) const;
|
2016-03-15 21:52:31 +00:00
|
|
|
private:
|
2016-04-04 18:10:28 +00:00
|
|
|
time_type start, end;
|
2016-03-15 21:52:31 +00:00
|
|
|
};
|
2016-04-04 18:10:28 +00:00
|
|
|
|
|
|
|
std::ostream& operator<<(std::ostream& stream, const TimeRange& timeRange);
|