From 5b6427dde0bb8e3b466793243bbfc185f4739ac6 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 14 Mar 2022 14:13:54 +0100 Subject: refactor: implement & use shared ptr --- src/sensor/calibration.hpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/sensor/calibration.hpp') diff --git a/src/sensor/calibration.hpp b/src/sensor/calibration.hpp index 17f8fa9..c85d336 100644 --- a/src/sensor/calibration.hpp +++ b/src/sensor/calibration.hpp @@ -1,5 +1,6 @@ #pragma once +#include "common/memory/shared_ptr.hpp" #include "sensor/sensor.hpp" #include "serial.hpp" @@ -51,7 +52,8 @@ public: * @param sensor A sensor to calibrate * @param sout A Serial output stream */ - SensorCalibrator(Sensor &sensor, SerialStream sout); + SensorCalibrator(common::SharedPtr sensor, + common::SharedPtr sout); /** * Calibrates the sensor. @@ -69,7 +71,6 @@ private: static void _adjustValues(SensorCalibratorValues &values); static bool _isValuesInRange(const SensorCalibratorValues &values); - Sensor &_sensor; - - SerialStream _sout; + common::SharedPtr _sensor; + common::SharedPtr _sout; }; -- cgit v1.2.3-18-g5258