Commit Graph

23 Commits

Author SHA1 Message Date
Jørgen Kvalsvik
7eb52f1023 Removes DeckKeyword's dependency on ParserKeyword
The completely constructed Deck isn't supposed to have any relationship
with the Parser structures (which are completely stateless in terms of
input data), and ParserKeyword in DeckKeyword was an anomaly. With
recent refactorings this lead to subtle lifetime issues.

This patch breaks this dependency and cleans up DeckKeyword accordingly,
while changing checkDeck to now take the parser as an additional
argument, to look up whether or not some DeckKeyword is in the right
section. This now also means that Parser* objects can be destroyed once
the Deck is created.

The Section::checkSectionTopology has been moved to Parser.cpp. It is a
temporary home for the feature to make the project compile nicely (i.e.
createKeywordList can be compiled as before, without introducing a
circular dependency on itself via Parser.cpp), until some proper cleanup
of the parser code has been done. It never really fully belonged in
Section.cpp anyway, so this is a first step in the direction of some
slight renaming.
2016-02-18 13:27:24 +01:00
Jørgen Kvalsvik
23007dd193 DeckKeyword uses automatic storage for records
DeckKeyword now internally uses a vector of records instead of a vector
of shared_ptr< DeckRecord >. Updates the interface to reflect this, by
returning references over shared_ptr. DeckKeyword is now the sole owner
of its own record resources.
2016-02-18 13:26:56 +01:00
Jørgen Kvalsvik
dc5afd5236 DeckKeyword::ParserKeyword to regular pointer 2016-02-18 13:26:55 +01:00
Jørgen Kvalsvik
8b12fda9c3 Remove unused FloatItem classes
ParserItemFloat and DeckItemFloat is never used within the project.
2016-02-03 12:22:41 +01:00
Jørgen Kvalsvik
f404828d63 Cleans up headers to improve build preformance
This is an effort to improve build performance.  Several includes
scattered across the project are either unused or partially used (i.e.
just used to import a type name, not depending on the actual contents of
the header file).

Replaces a lot of these includes with forward declarations.
2016-01-21 09:22:06 +01:00
Joakim Hove
714990ae97 DeckXXX returns const std::string&.
fixup! DeckStringItem returns const std::string&.
2015-09-11 14:03:28 +02:00
Joakim Hove
081b87b5b4 Removed m_deckIndex property from DeckKeyword 2014-12-09 11:56:05 +01:00
Andreas Lauser
ea38a25af4 remove all trailing white space
this is just the result of

```
find -iname "*.[ch]pp" | xargs sed -i "s/ *$//"
find opm/parser/share/keywords -type f |  xargs sed -i "s/ *$//"
```

so if it causes conflicts with other patches, the others should get
priority. The rationale behind this patch is that some people tell
their editor to remove white space which leads to larger than
necessary patches...
2014-12-08 16:34:28 +01:00
Andreas Lauser
f76113f2b1 DeckKeyword: retain the ParserKeyword object
this is useful because DeckKeywords can have almost arbitrary names
(which match a regular expression) which makes it hard to retrieve
additional information about the keyword after it has been created...
2014-10-07 14:22:47 +02:00
Andreas Lauser
38797ea534 DeckKeyword: retain the location of keywords
this is useful for log messages.
2014-10-07 14:22:47 +02:00
Joakim Hove
22ed38b319 Added iterators begin() and end() to DeckKeyword class. 2014-06-03 22:42:23 +02:00
Arne Morten Kvarving
463eae9b07 fixed: don't mix member names and function parameters 2014-05-19 13:15:09 +02:00
Joakim Hove
2786b5e87b Added isDataKeyword() property to deckKeyword. 2014-05-16 15:29:54 +02:00
Joakim Hove
4672e386f0 Added getDataSize() method to DeckKeyword. 2014-04-27 23:51:43 +02:00
Joakim Hove
edde68fa6a Added float data accessors. 2014-04-01 09:05:33 +02:00
Andreas Lauser
d261fcfe98 also constify the getSIDoubleData() method in DeckKeyword
in the item and in the record it already was marked as const, the
DeckKeyword class was forgotten during that excercise.
2014-01-15 12:52:12 +01:00
Joakim Hove
9de20014fc Correctly parses EQUIL with units. 2013-12-15 09:41:25 +01:00
Joakim Hove
7ea0bb8e53 Changed getDouble() -> getRawDouble throughout. 2013-12-10 14:16:54 +01:00
Joakim Hove
0598e9122a Added deckIndex property to deckKeyword 2013-10-22 11:40:45 +02:00
Joakim Hove
4088570085 Added methods const std::vector<T>& DeckKeyword::getTData() which goes all the way through DeckRecord(0)->DeckItem(0) 2013-09-22 18:53:29 +02:00
Kristian Flikka
3deab9cdf8 Changed unknown keyword concept to be a constructor only setting 2013-08-22 15:53:57 +02:00
Kristian Flikka
5f1c2722b5 Now also reading unrecognized keywords, labeled such in DeckKeyword class 2013-08-21 10:41:18 +02:00
Kristian Flikka
f1660460dc Replaced all instances of KW with Keyword. We can afford it. 2013-06-20 15:30:37 +02:00