Initializer list support makes some tests much easier to write (and
read) and enables some nifty features for when small, special-purpose
decks are needed.
The const_cast in Deck::get*UnitSystem are potentially undefined
behaviour under a series of (plausible) conditions, and are deprecated
in favour of mutable members. Removes initUnitSystem from the public
interface, as the initialisation is handled on the first getUnitSystem
anyway, cleaning up the Deck interface slightly.
Adds proper constness to the use of unit systems that don't actually
modify the internal state in any way.
The underlying iterators were default constructed (aka uninitialised)
when a Deck was default constructed, meaning possible invocation of
undefined behaviour.
While the empty Deck typically is only used for testing, this is a
possible bug in production code. This small patch makes sure even
default constructed Decks are well defined.
The deck no longer exposes shared_ptrs, but uses automatically managed
memory, meaning ownership of DeckKeywords are now obvious and clear.
shared_ptr in the interface has been replaced by references.
This refactoring reflects the ownership semantics of Deck* classes -
Section and Section-derived classes no longer claim ownership over
partial decks, but rather provide a -view- into an already
established Deck.
The Deck class itself is now unique in the sense that it is the only
supporter of write operations, meaning a DeckView derived instance can
never modify the deck it's viewing.
Every header is self-contained and includes only what it must to
function, relying on users include what they need in source files,
adopting a pay-what-you-use model (in particular for internal
dependencies).
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.
- Removed the KeywordContainer class; and implemented the behaviour
directly in the Deck.
- Added begin() and end() iterators to the Deck.
- Section class inherits from Deck.
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...