UDQFunctionTable.hpp
Go to the documentation of this file.
1/*
2 Copyright 2019 Equinor ASA.
3
4 This file is part of the Open Porous Media project (OPM).
5
6 OPM is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 OPM is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with OPM. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#ifndef UDQFUNCTIONTABLE_HPP
21#define UDQFUNCTIONTABLE_HPP
22
23#include <unordered_map>
24#include <memory>
25
28
29namespace Opm {
30
32public:
33 using FunctionMap = std::unordered_map<std::string,
34 std::shared_ptr<UDQFunction>>;
35 explicit UDQFunctionTable(const UDQParams& params);
38 const FunctionMap& map);
39 bool has_function(const std::string& name) const;
40 const UDQFunction& get(const std::string& name) const;
41
42 const UDQParams& getParams() const;
43 const FunctionMap& functionMap() const;
44
45 bool operator==(const UDQFunctionTable& data) const;
46
47private:
48 void insert_function(std::shared_ptr<UDQFunction> func);
49 UDQParams params;
50 FunctionMap function_table;
51};
52}
53#endif
const char *const name
Definition: cJSON.h:258
const char *const string
Definition: cJSON.h:170
Definition: UDQFunction.hpp:34
Definition: UDQFunctionTable.hpp:31
bool has_function(const std::string &name) const
const FunctionMap & functionMap() const
std::unordered_map< std::string, std::shared_ptr< UDQFunction > > FunctionMap
Definition: UDQFunctionTable.hpp:34
bool operator==(const UDQFunctionTable &data) const
UDQFunctionTable(const UDQParams &param, const FunctionMap &map)
const UDQParams & getParams() const
const UDQFunction & get(const std::string &name) const
UDQFunctionTable(const UDQParams &params)
Definition: UDQParams.hpp:31
std::vector< typename std::result_of< F(typename C::const_iterator::value_type &) >::type > map(F f, const C &src)
Definition: Functional.hpp:84
Definition: A.hpp:4
static std::string data()
Definition: exprtk.hpp:40022