From bc02054d56118110a36aea72d21f9d5e73d07d1f Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Tue, 22 Oct 2024 14:00:41 +0200 Subject: refactor file reading factory --- FileReaderFactory.h | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'FileReaderFactory.h') diff --git a/FileReaderFactory.h b/FileReaderFactory.h index 0829985..85521c0 100644 --- a/FileReaderFactory.h +++ b/FileReaderFactory.h @@ -1,27 +1,16 @@ #pragma once #include -#include #include #include "FileReader.h" -using FactoryMap = std::map; - class FileReaderFactory { public: - static std::unique_ptr open(const std::string url); + std::unique_ptr create(const std::string & url); -private: +public: FileReaderFactory() = default; virtual ~FileReaderFactory() = default; - -private: - static void register_strategy(const std::string type, const FileReader * node); - static FactoryMap & get_map(); - static const FileReader * find_reader(const std::string type); - -private: - friend FileReader; }; -- cgit v1.2.3