Renamed TimeSegment to TimeRange

This commit is contained in:
Daniel Wolf
2016-03-28 20:25:11 +02:00
parent 8c1e24e9c8
commit 2be3751a4f
7 changed files with 33 additions and 30 deletions

21
src/TimeRange.cpp Normal file
View File

@@ -0,0 +1,21 @@
#include "TimeRange.h"
#include <stdexcept>
TimeRange::TimeRange(centiseconds start, centiseconds end) :
start(start),
end(end)
{
if (start > end) throw std::invalid_argument("start must not be less than end.");
}
centiseconds TimeRange::getStart() const {
return start;
}
centiseconds TimeRange::getEnd() const {
return end;
}
centiseconds TimeRange::getLength() const {
return end - start;
}