2013-05-06 09:48:29 +02:00
|
|
|
/*
|
|
|
|
|
Copyright 2013 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/>.
|
2013-05-06 12:13:49 +02:00
|
|
|
*/
|
2013-05-06 09:48:29 +02:00
|
|
|
|
|
|
|
|
|
2013-05-07 21:55:49 +02:00
|
|
|
#ifndef PARSERINTITEM_HPP
|
2013-05-09 12:17:00 +02:00
|
|
|
#define PARSERINTITEM_HPP
|
2013-05-06 09:48:29 +02:00
|
|
|
|
2013-12-02 13:07:01 +01:00
|
|
|
#include <memory>
|
|
|
|
|
|
2013-07-31 16:15:22 +02:00
|
|
|
#include <opm/json/JsonObject.hpp>
|
|
|
|
|
|
2013-05-07 21:55:49 +02:00
|
|
|
#include <opm/parser/eclipse/Parser/ParserItem.hpp>
|
2013-05-09 12:17:00 +02:00
|
|
|
#include <opm/parser/eclipse/Parser/ParserEnums.hpp>
|
|
|
|
|
|
2013-05-08 14:31:20 +02:00
|
|
|
#include <opm/parser/eclipse/RawDeck/RawRecord.hpp>
|
2013-05-09 12:17:00 +02:00
|
|
|
|
|
|
|
|
|
2013-05-07 21:55:49 +02:00
|
|
|
namespace Opm {
|
2013-05-06 09:48:29 +02:00
|
|
|
|
2013-05-07 21:55:49 +02:00
|
|
|
class ParserIntItem : public ParserItem {
|
|
|
|
|
public:
|
2013-09-17 22:27:53 +02:00
|
|
|
ParserIntItem(const std::string& itemName);
|
2013-05-09 14:18:36 +02:00
|
|
|
ParserIntItem(const std::string& itemName, ParserItemSizeEnum sizeType);
|
2013-09-18 07:16:09 +02:00
|
|
|
ParserIntItem(const std::string& itemName, int defaultValue);
|
2013-05-09 14:18:36 +02:00
|
|
|
ParserIntItem(const std::string& itemName, ParserItemSizeEnum sizeType, int defaultValue);
|
2013-12-17 15:56:12 +01:00
|
|
|
explicit ParserIntItem(const Json::JsonObject& jsonConfig);
|
2013-05-09 12:17:00 +02:00
|
|
|
|
2013-12-14 10:11:59 +01:00
|
|
|
DeckItemPtr scan(RawRecordPtr rawRecord) const;
|
2013-10-23 20:48:32 +02:00
|
|
|
bool equal(const ParserItem& other) const;
|
2015-04-23 11:31:10 +02:00
|
|
|
|
|
|
|
|
std::string createCode() const;
|
|
|
|
|
void inlineClass(std::ostream& os, const std::string& indent) const;
|
|
|
|
|
std::string inlineClassInit(const std::string& parentClass) const;
|
2013-05-09 14:18:36 +02:00
|
|
|
|
2014-08-25 10:40:59 +02:00
|
|
|
int getDefault() const;
|
2014-11-11 15:26:18 +01:00
|
|
|
bool hasDefault() const;
|
2014-08-25 10:40:59 +02:00
|
|
|
void setDefault(int defaultValue);
|
2013-05-07 21:55:49 +02:00
|
|
|
private:
|
2013-05-09 14:18:36 +02:00
|
|
|
int m_default;
|
2013-05-07 21:55:49 +02:00
|
|
|
};
|
2013-05-14 21:27:32 +02:00
|
|
|
|
2013-12-02 13:07:01 +01:00
|
|
|
typedef std::shared_ptr<const ParserIntItem> ParserIntItemConstPtr;
|
|
|
|
|
typedef std::shared_ptr<ParserIntItem> ParserIntItemPtr;
|
2013-05-06 09:48:29 +02:00
|
|
|
}
|
2013-05-07 21:55:49 +02:00
|
|
|
|
2013-05-09 12:17:00 +02:00
|
|
|
#endif /* PARSERINTITEM_HPP */
|
2013-05-07 21:55:49 +02:00
|
|
|
|