Dune::Copasi 2.1.0-git79717215+dune.gitlab.629933
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages Concepts
exprtk.hh
Go to the documentation of this file.
1#ifndef DUNE_COPASI_EXPRTK_PARSER_HH
2#define DUNE_COPASI_EXPRTK_PARSER_HH
3
5
6#include <map>
7#include <mutex>
8#include <string>
9#include <vector>
10#include <memory>
11
12namespace Dune::Copasi {
13
14class ExprTkParser final : public Parser
15{
16public:
18
19 ExprTkParser(const ExprTkParser&) = delete;
21
24
25 ~ExprTkParser() override final;
26
27 using RangeField = typename Parser::RangeField;
28
29 using Function0D = typename Parser::Function0D;
30 using Function1D = typename Parser::Function1D;
31 using Function2D = typename Parser::Function2D;
32 using Function3D = typename Parser::Function3D;
33 using Function4D = typename Parser::Function4D;
34
35 void define_constant(const std::string& symbol, const RangeField& value) override final;
36
37 void define_function(const std::string& symbol, Function0D&& function) override final;
38
39 void define_function(const std::string& symbol, Function1D&& function) override final;
40
41 void define_function(const std::string& symbol, Function2D&& function) override final;
42
43 void define_function(const std::string& symbol, Function3D&& function) override final;
44
45 void define_function(const std::string& symbol, Function4D&& function) override final;
46
47 void compile() override final;
48
49 [[nodiscard]] RangeField operator()() const noexcept override final;
50
51private:
52 using Parser::_compiled;
53 using Parser::_expression;
54 using Parser::_symbols;
55 using Parser::_variables;
56
57 std::shared_ptr<void> _data;
58};
59
60} // namespace Dune::Copasi
61
62#endif // DUNE_COPASI_EXPRTK_PARSER_HH
Definition: exprtk.hh:15
typename Parser::Function0D Function0D
Definition: exprtk.hh:29
void compile() override final
ExprTkParser & operator=(ExprTkParser &&)=default
typename Parser::Function3D Function3D
Definition: exprtk.hh:32
void define_constant(const std::string &symbol, const RangeField &value) override final
typename Parser::Function2D Function2D
Definition: exprtk.hh:31
ExprTkParser(const ExprTkParser &)=delete
~ExprTkParser() override final
ExprTkParser(ExprTkParser &&)=default
void define_function(const std::string &symbol, Function0D &&function) override final
typename Parser::Function1D Function1D
Definition: exprtk.hh:30
typename Parser::Function4D Function4D
Definition: exprtk.hh:33
ExprTkParser & operator=(const ExprTkParser &)=delete
typename Parser::RangeField RangeField
Definition: exprtk.hh:27
Definition: parser.hh:16
Definition: axis_names.hh:7