From 320fdeb9d8355d3c361d5c6d60de8afc64501af9 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Wed, 30 Aug 2023 16:48:10 +1000 Subject: Use a service locator instead of passing around subsets of drivers between FSMs --- src/drivers/include/relative_wheel.hpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/drivers/include/relative_wheel.hpp') diff --git a/src/drivers/include/relative_wheel.hpp b/src/drivers/include/relative_wheel.hpp index 5e801aba..b5532a4c 100644 --- a/src/drivers/include/relative_wheel.hpp +++ b/src/drivers/include/relative_wheel.hpp @@ -20,11 +20,7 @@ namespace drivers { class RelativeWheel { public: - static auto Create(TouchWheel* touch) -> RelativeWheel* { - return new RelativeWheel(touch); - } - - explicit RelativeWheel(TouchWheel* touch); + explicit RelativeWheel(TouchWheel& touch); auto Update() -> void; auto SetEnabled(bool) -> void; @@ -37,7 +33,7 @@ class RelativeWheel { RelativeWheel& operator=(const RelativeWheel&) = delete; private: - TouchWheel* touch_; + TouchWheel& touch_; bool is_enabled_; -- cgit v1.2.3