From 499d5a942fc2ad0149b0a16e978e090336dd8319 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Tue, 7 Nov 2023 10:32:07 +1100 Subject: Add a wrapper codec source that does readahead --- src/system_fsm/include/service_locator.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/system_fsm/include') diff --git a/src/system_fsm/include/service_locator.hpp b/src/system_fsm/include/service_locator.hpp index 24dc1eb9..327d0c50 100644 --- a/src/system_fsm/include/service_locator.hpp +++ b/src/system_fsm/include/service_locator.hpp @@ -17,6 +17,7 @@ #include "samd.hpp" #include "storage.hpp" #include "tag_parser.hpp" +#include "tasks.hpp" #include "touchwheel.hpp" #include "track_queue.hpp" @@ -111,6 +112,15 @@ class ServiceLocator { collator_ = std::move(i); } + auto bg_worker() -> tasks::Worker& { + assert(bg_worker_ != nullptr); + return *bg_worker_; + } + + auto bg_worker(std::unique_ptr w) -> void { + bg_worker_ = std::move(w); + } + // Not copyable or movable. ServiceLocator(const ServiceLocator&) = delete; ServiceLocator& operator=(const ServiceLocator&) = delete; @@ -129,6 +139,8 @@ class ServiceLocator { std::unique_ptr tag_parser_; std::unique_ptr collator_; + std::unique_ptr bg_worker_; + drivers::SdState sd_; }; -- cgit v1.2.3