- Jul 12, 2019
-
-
Mark OLESEN authored
- the Enum::readEntry() method was previously as bit sloppy with respect to the enumeration that it accepted. If the input was non-mandatory, typos would go unnoticed. Now tighten things so that if an enumeration is found, it must also be valid. STYLE: remove unused/deprecated Enum::lookupOrFailsafe() method - this was only used in a few places internally in 1712 and 1806 but has since then been superseded by getOrDefault() with an optional 'failsafe' flag.
-
- May 21, 2019
-
-
Mark OLESEN authored
- can be used to check the validity of input values. Example: dict.getCheck<label>("nIters", greaterOp1<label>(0)); dict.getCheck<scalar>("relax", scalarMinMax::zero_one()); - use 'get' prefix for more regular dictionary methods. Eg, getOrDefault() as alternative to lookupOrDefault() - additional ops for convenient construction of predicates ENH: make dictionary writeOptionalEntries integer - allow triggering of Fatal if default values are used ENH: additional scalarRange static methods: ge0, gt0, zero_one - use GREAT instead of VGREAT for internal placeholders - additional MinMax static methods: gt, le
-
- Feb 08, 2019
-
-
Mark OLESEN authored
-
- Oct 18, 2018
-
-
Mark OLESEN authored
- more dictionary-like methods, enforce keyType::LITERAL for all lookups to avoid any spurious keyword matching. - new readEntry, readIfPresent methods - The get() method replaces the now deprecate lookup() method. - Deprecate lookupOrFailsafe() Failsafe behaviour is now an optional parameter for lookupOrDefault, which makes it easier to tailor behaviour at runtime. - output of the names is now always flatted without line-breaks. Thus, os << flatOutput(someEnumNames.names()) << nl; os << someEnumNames << nl; both generate the same output. - Constructor now uses C-string (const char*) directly instead of Foam::word in its initializer_list. - Remove special enum + initializer_list constructor form since it can create unbounded lookup indices. - Removd old hasEnum, hasName forms that were provided during initial transition from NamedEnum. - Added static_assert on Enum contents to restrict to enum or integral values. Should not likely be using this class to enumerate other things since it internally uses an 'int' for its values. Changed volumeType accordingly to enumerate on its type (enum), not the class itself.
-
- Sep 19, 2018
-
-
Mark OLESEN authored
-
- Jun 07, 2018
-
-
Mark OLESEN authored
- propagates check for lookupOrDefault etc.
-
- Nov 28, 2017
-
-
Mark OLESEN authored
- found() method for consistency with other classes - operator()(name, deflt) for similarity to lookupOrDefault, but without a dictionary
-
- Jul 07, 2017
-
-
Mark OLESEN authored
- if the enum name is not found, then warn and return the default.
-
- May 29, 2017
-
-
Mark OLESEN authored
- the NamedEnum wrapper is somewhate too rigid. * All enumerated values are contiguous, starting as zero. * The implicit one-to-one mapping precludes using it for aliases. * For example, perhaps we want to support alternative lookup names for an enumeration, or manage an enumeration lookup for a sub-range.
-