Restructures createRawKeyword to use multiple return statements over
if-else and updating variables, reducing indentation to have fewer
contemporary branches.
Changes the control flow of Parser::createRawKeyword to return on
failing to meet preconditions, rather than if-else block. Reduces
indentation and concurrent code paths.
Makes the actual effects of the various condtions more clear by
emphasising the return of the function rather than some possible action
after the loop.
Restructures the per-iteration check of whether or not to continue
parsing to happen first and be an early-break, instead of this flow
being handled by if-else.
The implementation has been rewritten to use iterators and renamed for
internal use. The public static function still exists for testability
and easy verification, but should be considered an internal part of the
parser.
this breaks with g++ 4.8 used in redhat builds.
/usr/include/boost148/boost/filesystem/v3/path.hpp:710:24 error: 'path'
is already declared in this scope.
* Added Eclipse3DPropertiesTests
* Refactored tests to use Eclipse3DProperties instead of EclipseState
* Added unsigned literal to MessageContainerTest
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.
By storing it as size_t we explicitly disallow negative line numbers,
and keep 0 as an error/empty/undefined location.
A small problem with this is that MessageContainer.error and friends
still accept negative numbers (often without warning) via size_t
implicit conversion and wrap-around.
For more transactional behaviour and to support MessageContainer in
favour of opm-log, this method now returns an enum describing how the
error should be handled, rather than throwing or no-oping. Throwing is
preserved if ParseContext is configured to do so.
While the implementation is a simple alias to
std::vector<Message>::const_iterator, it enablese generic lookup of the
iterator type at compile time, and enables us to effortlessly change the
underlying implementation later.
Some phenomenons can be configured as error, warning or debug output,
and is not necessarily known in advanced by the entity adding a message.
To facilite adding a message with runtime-defined warning level, the add
method is supported.
By supporting operator bool() we get the same existence checking
capabilities as the unique_ptr implementations, without the hurdles of
non-copyability and manual heap allocation.
The general loop through all raw records should be based on the iterator
interface of the RawKeyword, but to resolve INCLUDE statements we have
implemented a special case method to get the first record.
Since RawRecords now has automatic storage, managed by std::list,
offering iterators is feasible. The random access
RawKeyword::getRecord's real use was accessing the records in order,
which now is handled via iterators.