diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-22 14:44:47 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-22 14:44:47 +0200 |
commit | 8c0562c8ef37cd5e80c58609f7bc7ae352365f65 (patch) | |
tree | 42e9906c5ddf1b0e719ee3eb7b965a444be64c38 /ParserFactory.h | |
parent | bc02054d56118110a36aea72d21f9d5e73d07d1f (diff) |
refactor parser factory
Diffstat (limited to 'ParserFactory.h')
-rw-r--r-- | ParserFactory.h | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/ParserFactory.h b/ParserFactory.h index 5430366..cb8cb99 100644 --- a/ParserFactory.h +++ b/ParserFactory.h @@ -1,20 +1,16 @@ #pragma once +#include <memory> + #include "FileReader.h" -#include "MuseumDeserializer.h" #include "Parser.h" class ParserFactory { - typedef std::vector<Parser*> ParserCollection; - public: - static void parse(FileReader & f, MuseumDeserializer & d); - static void register_strategy(Parser * p); + ParserFactory(); + Parser & get_parser(FileReader & f); private: - static ParserCollection & get_collection() { - static ParserCollection c = {}; - return c; - } + std::vector<std::unique_ptr<Parser>> parsers; }; |