since we still support g++-7, where filesystem is marked experimental,
we introduce a wrapper header and expose the namespace to use
as Opm::filesystem.
for gcc we unconditionally link with libstdc++fs in the python bindings.
the setup.py stuff links as c code, not c++ code, so it is not
automatically added on any gcc version. this might prove unportable
later.
The DeckKeyword::DeckKeyword(const std::string&) constructor has been removed
and the DeckKeyword now requires a ParserKeyword pointer in the constructor.
- the implicit casts from std::string/char* is part of the design for
the view class so we do not want to disable those.
- intializer list constructors should be implicitly called
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.
This commit is a first step towards reducing the use of the Deck api
outside of opm-parser. Downstream modules should preferably use the
EclipseState api which is richer in features, and also easier to use
correctly.
The current form of the code is temporary, in the future we will remove
the OPM_PARSER_DECK_API_WARNING compile guard.
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.