STYLE: use getOrDefault instead of lookupOrDefault

- now mark methods with strict deprecation, to make it easier to find
  their use but without adding extra compilation noise for others

ENH: minor update for Enum methods and iterator

- add warnOnly (failsafe) option for readEntry and getOrDefault

- add good() method to Enum iterator (simliar to HashTable)

- replace unused/fragile Enum find() methods with iterator return
  that can be used more generally
This commit is contained in:
Mark Olesen
2023-10-13 19:27:27 +02:00
parent 3562565995
commit fb26fcedfc
26 changed files with 197 additions and 129 deletions

View File

@ -96,7 +96,7 @@ bool Foam::functionObjects::setTimeStepFaRegionsFunctionObject::read
if (timeFunctionObject::read(dict))
{
// Ensure that adjustTimeStep is active
if (!time_.controlDict().lookupOrDefault<bool>("adjustTimeStep", false))
if (!time_.controlDict().getOrDefault<bool>("adjustTimeStep", false))
{
FatalIOErrorInFunction(dict)
<< "Need to set 'adjustTimeStep' true to allow timestep control"