i_clock Last update: 16.07.2025 1 5 6 #pragma once 7 8 #include "core/time/i_clock/timestamp.h" 9 #include <chrono> 10 #include <memory> 11 12 namespace simulation_framework 13 { 14 namespace core 15 { 20 namespace time 21 { 22 23 template <class Duration> 24 using timepoint = std::chrono::time_point<std::chrono::system_clock, Duration>; 25 using milliseconds = std::chrono::milliseconds; 26 28 32 class IClock 33 { 34 public: 35 virtual ~IClock() = default; 36 virtual void SetNow(const milliseconds& ms) = 0; 37 virtual void SetNow(const Timestamp& timestamp) = 0; 38 virtual milliseconds GetNow() const = 0; 39 virtual Timestamp GetNowAsTimestamp() const = 0; 40 virtual void IncrementBy(const milliseconds& ms) = 0; 41 }; 42 43 } // namespace time 44 } // namespace core 45 } // namespace simulation_framework