-
Notifications
You must be signed in to change notification settings - Fork 8
/
SensorManager.hpp
36 lines (28 loc) · 921 Bytes
/
SensorManager.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef CPP_REFACTORING_FOR_TESTABILITY_SENSORMANAGER_HPP
#define CPP_REFACTORING_FOR_TESTABILITY_SENSORMANAGER_HPP
#include "InfraredSensor.hpp" // Remove this after refactoring
#include "LaserSensor.hpp" // Remove this after refactoring
#include "SensorFactory.hpp"
#include "SensorScanner.hpp"
#include "UltrasonicSensor.hpp" // Remove this after refactoring
namespace before
{
struct SensorManager
{
SensorManager(SensorScanner& sensorScanner);
std::vector<int> getSurroundingDistances() const;
private:
std::vector<std::unique_ptr<Sensor>> mSensors;
};
} // namespace before
namespace after
{
struct SensorManager
{
SensorManager(SensorScanner& sensorScanner, SensorFactory& sensorFactory);
std::vector<int> getSurroundingDistances() const;
private:
std::vector<std::unique_ptr<Sensor>> mSensors;
};
} // namespace after
#endif // CPP_REFACTORING_FOR_TESTABILITY_SENSORMANAGER_HPP