Loading...
Searching...
No Matches
KeywordHandlers.hpp
/*
Copyright 2020 Statoil ASA.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef KEYWORD_HANDLERS_HPP
#define KEYWORD_HANDLERS_HPP
#include <functional>
#include <string>
#include <unordered_map>
namespace Opm {
class HandlerContext;
class KeywordHandlers
{
public:
using handler_function = std::function<void(HandlerContext&)>;
static const KeywordHandlers& getInstance();
bool handleKeyword(HandlerContext& handlerContext) const;
private:
KeywordHandlers();
using HandlerFunctionMap = std::unordered_map<std::string,handler_function>;
HandlerFunctionMap handler_functions;
};
}
#endif
Opm::HandlerContext
Definition HandlerContext.hpp:48
Opm::KeywordHandlers
Singleton class for Keyword handlers in Schedule.
Definition KeywordHandlers.hpp:32
Opm::KeywordHandlers::getInstance
static const KeywordHandlers & getInstance()
Obtain singleton instance.
Definition KeywordHandlers.cpp:324
Opm::KeywordHandlers::handler_function
std::function< void(HandlerContext &)> handler_function
Handler function type.
Definition KeywordHandlers.hpp:34
Opm::KeywordHandlers::handleKeyword
bool handleKeyword(HandlerContext &handlerContext) const
Handle a keyword.
Definition KeywordHandlers.cpp:385
Opm
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30