Mercurial > minori
comparison include/core/session.h @ 221:53211cb1e7f5
library: add initial library stuff
nice
| author | Paper <paper@paper.us.eu.org> |
|---|---|
| date | Mon, 08 Jan 2024 13:21:08 -0500 |
| parents | 975a3f0965e2 |
| children | 4d461ef7d424 |
comparison
equal
deleted
inserted
replaced
| 220:79a87a6dd39d | 221:53211cb1e7f5 |
|---|---|
| 2 #define __core__session_h | 2 #define __core__session_h |
| 3 | 3 |
| 4 #include "core/config.h" | 4 #include "core/config.h" |
| 5 #include "gui/locale.h" | 5 #include "gui/locale.h" |
| 6 #include <QElapsedTimer> | 6 #include <QElapsedTimer> |
| 7 | |
| 8 #include "semver/semver.hpp" | |
| 7 | 9 |
| 8 struct Session { | 10 struct Session { |
| 9 public: | 11 public: |
| 10 Session() { timer.start(); } | 12 Session() { timer.start(); } |
| 11 /* we literally *cannot* be lying to the user by doing this */ | 13 /* we literally *cannot* be lying to the user by doing this */ |
| 12 void IncrementRequests() { requests++; }; | 14 void IncrementRequests() { requests++; }; |
| 13 int GetRequests() { return requests; }; | 15 int GetRequests() { return requests; }; |
| 14 int uptime() { return timer.elapsed(); } | 16 int uptime() { return timer.elapsed(); } |
| 15 | 17 |
| 16 Config config; | 18 Config config; |
| 19 static constexpr semver::version version{0, 1, 0, semver::prerelease::alpha, 1}; | |
| 17 | 20 |
| 18 private: | 21 private: |
| 19 unsigned int requests = 0; | 22 unsigned int requests = 0; |
| 20 QElapsedTimer timer; | 23 QElapsedTimer timer; |
| 21 }; | 24 }; |
