diff --git a/doomsday/libs/core/include/de/data/list.h b/doomsday/libs/core/include/de/data/list.h index 9ec18bf28a..3438e3dde8 100644 --- a/doomsday/libs/core/include/de/data/list.h +++ b/doomsday/libs/core/include/de/data/list.h @@ -63,7 +63,10 @@ class List : public std::vector using Base::begin; using Base::end; + using Base::cbegin; + using Base::cend; using Base::push_back; + using Base::emplace_back; using Base::size; void pop_front() { removeFirst(); } // slow... void push_front(const T &v) { prepend(v); } // slow... @@ -105,6 +108,7 @@ class List : public std::vector void removeLast() { Base::erase(Base::begin() + size() - 1); } void removeAt(size_t pos) { Base::erase(Base::begin() + pos); } void removeAll(const T &v) { Base::erase(std::remove(begin(), end(), v), end()); } + void remove(size_t pos, size_t count) { Base::erase(cbegin() + pos, cbegin() + pos + count); } bool removeOne(const T &v) { auto found = std::find(begin(), end(), v); diff --git a/doomsday/libs/core/include/de/data/time.h b/doomsday/libs/core/include/de/data/time.h index 3a5f6f5871..8b01f657fc 100644 --- a/doomsday/libs/core/include/de/data/time.h +++ b/doomsday/libs/core/include/de/data/time.h @@ -154,7 +154,7 @@ class DE_PUBLIC Time : public ISerializable HumanDate, ///< human-entered date (only with Time::fromText) UnixLsStyleDateTime, }; - + using TimePoint = std::chrono::system_clock::time_point; public: @@ -303,6 +303,8 @@ class DE_PUBLIC Time : public ISerializable static void updateCurrentHighPerformanceTime(); + static Span currentHighPerformanceDelta(); + /** * Parses a text string into a Time. * diff --git a/doomsday/libs/core/src/data/time.cpp b/doomsday/libs/core/src/data/time.cpp index 85b115201f..e6196e7c2f 100644 --- a/doomsday/libs/core/src/data/time.cpp +++ b/doomsday/libs/core/src/data/time.cpp @@ -531,7 +531,7 @@ Time Time::parse(const String &text, const char *format) // static } if (is.fail()) return Time::invalidTime(); } - + // Assume missing date values. if (year == 0) { @@ -746,6 +746,11 @@ void Time::updateCurrentHighPerformanceTime() // static currentHighPerfDelta = highPerfTimer().elapsed(); } +Time::Span Time::currentHighPerformanceDelta() +{ + return currentHighPerfDelta; +} + std::ostream &operator<<(std::ostream &os, Time const &t) { return os << t.asText();