Make LogReader own SimulatedEventLoopFactory
This reduces some code duplication and makes things easier once we start
need to be able to mess with the config from the LogReader.
Change-Id: Ia1c04f37865cfd284c3675ca138d38b3f4b7717f
diff --git a/aos/events/logging/log_cat.cc b/aos/events/logging/log_cat.cc
index 45f0811..1d1dd8b 100644
--- a/aos/events/logging/log_cat.cc
+++ b/aos/events/logging/log_cat.cc
@@ -28,12 +28,10 @@
aos::InitGoogle(&argc, &argv);
aos::logger::LogReader reader(FLAGS_logfile);
- aos::SimulatedEventLoopFactory log_reader_factory(reader.configuration(),
- reader.node());
- reader.Register(&log_reader_factory);
+ reader.Register();
std::unique_ptr<aos::EventLoop> printer_event_loop =
- log_reader_factory.MakeEventLoop("printer");
+ reader.event_loop_factory()->MakeEventLoop("printer");
printer_event_loop->SkipTimingReport();
bool found_channel = false;
@@ -88,9 +86,7 @@
LOG(FATAL) << "Could not find any channels";
}
- log_reader_factory.Run();
-
- reader.Deregister();
+ reader.event_loop_factory()->Run();
aos::Cleanup();
return 0;