refactoring

This commit is contained in:
Jonas Zeunert
2018-05-06 19:26:59 +02:00
parent 20b5be8bfa
commit c2fb59139b
5 changed files with 39 additions and 38 deletions

View File

@@ -22,7 +22,7 @@ class InputFactory
{
public:
static Detector* get_detector(std::string& input_config_path, std::string& matrix_config_path)
static std::shared_ptr<Detector> get_detector(std::string& input_config_path, std::string& matrix_config_path)
{
std::ifstream input_config_stream(input_config_path);
json input_config;
@@ -34,7 +34,7 @@ public:
std::vector<InputEvent> input_events = create_input_events(matrix_config);
return new Detector(input_config, input_events);
return std::shared_ptr<Detector>(Detector(input_config, input_events));
}
private: