Dune::Copasi
Loading...
Searching...
No Matches
factory.hh
Go to the documentation of this file.
1#ifndef DUNE_COPASI_PARSER_FACTORY_HH
2#define DUNE_COPASI_PARSER_FACTORY_HH
3
5
6#include <memory>
7#include <unordered_map>
8
9namespace Dune::Copasi {
10
11enum class ParserType
12{
13 None,
17 ExprTk
18};
19
20extern const ParserType default_parser;
21
22inline const static std::unordered_map<ParserType, std::string_view> parser2string = {
23 { ParserType::None, "None" },
24 { ParserType::SymEngine, "SymEngine" },
25 { ParserType::SymEngineSBML, "SymEngineSBML" },
26 { ParserType::MuParser, "MuParser" },
27 { ParserType::ExprTk, "ExprTk" }
28};
29
30inline const static std::unordered_map<std::string_view, ParserType> string2parser = {
31 { "None", ParserType::None },
32 { "SymEngine", ParserType::SymEngine },
33 { "SymEngineSBML", ParserType::SymEngineSBML },
34 { "MuParser", ParserType::MuParser },
35 { "ExprTk", ParserType::ExprTk }
36};
37
38inline const static std::string default_parser_str =
39 std::string{ parser2string.at(default_parser) };
40
41[[nodiscard]] std::unique_ptr<Parser>
43
44[[nodiscard]] std::unique_ptr<Parser>
45make_parser(std::string_view parser_type);
46
47} // namespace Dune::Copasi
48
49#endif // DUNE_COPASI_PARSER_FACTORY_HH
Definition axis_names.hh:7
const ParserType default_parser
std::unique_ptr< Parser > make_parser(ParserType parser_type=default_parser)
constexpr bool is_bitflags_v
Alias for Bitflag indicator.
Definition bit_flags.hh:24
ParserType
Definition factory.hh:12