diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-22 14:00:41 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-22 14:00:41 +0200 |
commit | bc02054d56118110a36aea72d21f9d5e73d07d1f (patch) | |
tree | 2fc49dd3f93307df6242b8e63bca0e26b2e62168 /FileReaderFactory.h | |
parent | fab0fccc0aaa18e915bcd08e81e5a04177e435cd (diff) |
refactor file reading factory
Diffstat (limited to 'FileReaderFactory.h')
-rw-r--r-- | FileReaderFactory.h | 15 |
1 files changed, 2 insertions, 13 deletions
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 <string> -#include <map> #include <memory> #include "FileReader.h" -using FactoryMap = std::map<std::string, const FileReader *>; - class FileReaderFactory { public: - static std::unique_ptr<FileReader> open(const std::string url); + std::unique_ptr<FileReader> 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; }; |