Added deckIndex property to deckKeyword
This commit is contained in:
@@ -24,11 +24,21 @@ namespace Opm {
|
||||
DeckKeyword::DeckKeyword(const std::string& keywordName) {
|
||||
m_knownKeyword = true;
|
||||
m_keywordName = keywordName;
|
||||
m_deckIndex = -1;
|
||||
}
|
||||
|
||||
DeckKeyword::DeckKeyword(const std::string& keywordName, bool knownKeyword) {
|
||||
m_knownKeyword = knownKeyword;
|
||||
m_keywordName = keywordName;
|
||||
m_deckIndex = -1;
|
||||
}
|
||||
|
||||
ssize_t DeckKeyword::getDeckIndex() const {
|
||||
return m_deckIndex;
|
||||
}
|
||||
|
||||
void DeckKeyword::setDeckIndex(size_t deckIndex) {
|
||||
m_deckIndex = deckIndex;
|
||||
}
|
||||
|
||||
std::string DeckKeyword::name() const {
|
||||
|
||||
@@ -28,6 +28,9 @@ namespace Opm {
|
||||
DeckRecordConstPtr getDataRecord() const;
|
||||
bool isKnown() const;
|
||||
|
||||
ssize_t getDeckIndex() const;
|
||||
void setDeckIndex(size_t deckIndex);
|
||||
|
||||
const std::vector<int>& getIntData() const;
|
||||
const std::vector<double>& getDoubleData() const;
|
||||
const std::vector<std::string>& getStringData() const;
|
||||
@@ -36,7 +39,7 @@ namespace Opm {
|
||||
std::string m_keywordName;
|
||||
std::vector<DeckRecordConstPtr> m_recordList;
|
||||
bool m_knownKeyword;
|
||||
|
||||
ssize_t m_deckIndex;
|
||||
};
|
||||
typedef boost::shared_ptr<DeckKeyword> DeckKeywordPtr;
|
||||
typedef boost::shared_ptr<const DeckKeyword> DeckKeywordConstPtr;
|
||||
|
||||
@@ -69,6 +69,15 @@ BOOST_AUTO_TEST_CASE(setUnknown_wasknown_nowunknown) {
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(DeckIndex) {
|
||||
DeckKeywordPtr deckKeyword(new DeckKeyword("KW"));
|
||||
BOOST_CHECK_EQUAL( -1 , deckKeyword->getDeckIndex());
|
||||
deckKeyword->setDeckIndex( 10);
|
||||
BOOST_CHECK_EQUAL(10 , deckKeyword->getDeckIndex());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user