Rework library without unix sockets for now
This commit is contained in:
parent
e9ae1a320a
commit
0bef6035ae
30 changed files with 987 additions and 136 deletions
23
server_v2/include/Cache.hpp
Normal file
23
server_v2/include/Cache.hpp
Normal 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
|
Reference in a new issue