Rework library without unix sockets for now

This commit is contained in:
Konstantin Lampalzer 2022-05-21 23:29:55 +02:00
parent e9ae1a320a
commit 0bef6035ae
30 changed files with 987 additions and 136 deletions

View file

@ -0,0 +1,23 @@
#ifndef COMPLIB_SERVER_CACHE_HPP
#define COMPLIB_SERVER_CACHE_HPP
#include <chrono>
class Cache {
public:
explicit Cache(int rate_hz);
bool is_expired();
void update();
private:
typedef std::chrono::steady_clock clock;
std::chrono::microseconds cache_duration{};
std::chrono::time_point<std::chrono::steady_clock> last_update{};
};
#endif //COMPLIB_SERVER_CACHE_HPP