make DeckKeyword constructible from variables
also make it default constructible and add accessors
This commit is contained in:
@@ -41,11 +41,18 @@ namespace Opm {
|
||||
|
||||
typedef std::vector< DeckRecord >::const_iterator const_iterator;
|
||||
|
||||
DeckKeyword();
|
||||
explicit DeckKeyword(const ParserKeyword& parserKeyword);
|
||||
DeckKeyword(const Location& location, const std::string& keywordName);
|
||||
DeckKeyword(const ParserKeyword& parserKeyword, const std::vector<std::vector<DeckValue>>& record_list, UnitSystem& system_active, UnitSystem& system_default);
|
||||
DeckKeyword(const ParserKeyword& parserKeyword, const std::vector<int>& data);
|
||||
DeckKeyword(const ParserKeyword& parserKeyword, const std::vector<double>& data, UnitSystem& system_active, UnitSystem& system_default);
|
||||
DeckKeyword(const std::string& kwName,
|
||||
const Location& loc,
|
||||
const std::vector<DeckRecord>& record,
|
||||
bool dataKw,
|
||||
bool slashTerminated);
|
||||
|
||||
|
||||
const std::string& name() const;
|
||||
void setFixedSize();
|
||||
@@ -56,11 +63,13 @@ namespace Opm {
|
||||
void addRecord(DeckRecord&& record);
|
||||
const DeckRecord& getRecord(size_t index) const;
|
||||
DeckRecord& getRecord(size_t index);
|
||||
const std::vector<DeckRecord>& records() const;
|
||||
const DeckRecord& getDataRecord() const;
|
||||
void setDataKeyword(bool isDataKeyword = true);
|
||||
void setDoubleRecordKeyword(bool isDoubleRecordKeyword = true);
|
||||
bool isDataKeyword() const;
|
||||
bool isDoubleRecordKeyword() const;
|
||||
bool isSlashTerminated() const;
|
||||
|
||||
const std::vector<int>& getIntData() const;
|
||||
const std::vector<double>& getRawDoubleData() const;
|
||||
|
||||
@@ -38,6 +38,12 @@ namespace Opm {
|
||||
{
|
||||
}
|
||||
|
||||
DeckKeyword::DeckKeyword() :
|
||||
m_isDataKeyword(false),
|
||||
m_slashTerminated(false)
|
||||
{
|
||||
}
|
||||
|
||||
DeckKeyword::DeckKeyword(const Location& location, const std::string& keywordName) :
|
||||
m_keywordName(keywordName),
|
||||
m_location(location),
|
||||
@@ -174,6 +180,19 @@ namespace Opm {
|
||||
addRecord( std::move(deck_record) );
|
||||
}
|
||||
|
||||
DeckKeyword::DeckKeyword(const std::string& kwName,
|
||||
const Location& loc,
|
||||
const std::vector<DeckRecord>& record,
|
||||
bool dataKw,
|
||||
bool slashTerminated) :
|
||||
m_keywordName(kwName),
|
||||
m_location(loc),
|
||||
m_recordList(record),
|
||||
m_isDataKeyword(dataKw),
|
||||
m_slashTerminated(slashTerminated)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DeckKeyword::setFixedSize() {
|
||||
@@ -325,5 +344,13 @@ namespace Opm {
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
const std::vector<DeckRecord>& DeckKeyword::records() const {
|
||||
return m_recordList;
|
||||
}
|
||||
|
||||
bool DeckKeyword::isSlashTerminated() const {
|
||||
return m_slashTerminated;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user