Support replaying the realtime clock from logs
This adds the concept of the realtime offset to the event scheduler.
Side note: the event scheduler is going to have to get significantly
more complicated when multi-node log files show up.
Change-Id: Ia6f891c77b8c3badcea930cdfa0e236acbff7801
diff --git a/aos/events/simulated_event_loop.h b/aos/events/simulated_event_loop.h
index 740a4c2..fee3ef0 100644
--- a/aos/events/simulated_event_loop.h
+++ b/aos/events/simulated_event_loop.h
@@ -81,6 +81,12 @@
return scheduler_.realtime_now();
}
+ // Sets realtime clock to realtime_now for a given monotonic clock.
+ void SetRealtimeOffset(monotonic_clock::time_point monotonic_now,
+ realtime_clock::time_point realtime_now) {
+ scheduler_.SetRealtimeOffset(monotonic_now, realtime_now);
+ }
+
private:
const Configuration *const configuration_;
EventScheduler scheduler_;