From d8289105193707daede1a5b59137f18e20f20aeb Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Fri, 18 Oct 2024 15:48:14 +0200 Subject: (2/2) rename --- FileReaderFactory.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 FileReaderFactory.h (limited to 'FileReaderFactory.h') diff --git a/FileReaderFactory.h b/FileReaderFactory.h new file mode 100644 index 0000000..0829985 --- /dev/null +++ b/FileReaderFactory.h @@ -0,0 +1,27 @@ +#pragma once + +#include +#include +#include + +#include "FileReader.h" + +using FactoryMap = std::map; + +class FileReaderFactory { +public: + static std::unique_ptr open(const std::string url); + +private: + 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