41 #ifndef Foam_substitutionModel_H 42 #define Foam_substitutionModel_H 179 virtual bool update() {
return true; }
182 virtual bool valid(
const word& keyName)
const = 0;
185 virtual bool apply(
const word&
key,
string& buffer)
const = 0;
static bool replaceBuiltin(const word &key, string &str)
Replace key in string.
virtual bool valid(const word &keyName) const =0
Return true of model applies to this keyName.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
static autoPtr< substitutionModel > New(const dictionary &dict, const Time &time)
Return a reference to the selected substitution model.
Base class for substitution models.
virtual bool apply(const word &key, string &buffer) const =0
Apply substitutions to this string buffer.
static void setBuiltin(const word &key, const Type &value)
Set a builtin to the hash table.
const Time & time_
Reference to the time database.
TypeName("substitutionModel")
Runtime type information.
static void setBuiltinStr(const word &key, const string &value)
Set a builtin to the hash table.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static void addBuiltinStr(const word &key, const string &value)
Add a builtin to the hash table - does not overwrite.
A class for handling words, derived from Foam::string.
declareRunTimeSelectionTable(autoPtr, substitutionModel, dictionary,(const dictionary &dict, const Time &time),(dict, time))
auto key(const Type &t) -> std::enable_if_t< std::is_enum_v< Type >, std::underlying_type_t< Type > >
A HashTable similar to std::unordered_map.
static const word KEY_BEGIN
Keyword starting characters.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
static HashTable< string > builtin_
Built-in substitutions.
static bool containsBuiltin(const word &key)
Return true if key is builtin.
const dictionary dict_
Construction dictionary.
virtual ~substitutionModel()=default
Destructor.
static void writeBuiltins(Ostream &os)
Write all builtins to stream.
static wordList getKeys(string &buffer)
Return all keys from a string buffer.
static const word KEY_END
Keyword ending characters.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Macros to ease declaration of run-time selection tables.
static void addBuiltin(const word &key, const Type &value)
Add a builtin to the hash table - does not overwrite.
virtual wordList keys() const =0
Return a word list of the keys.
static word cleanKey(const string &str)
Clean the key text.
static string keyify(const word &w)
Return a key representation from a word.
virtual bool update()
Update model local data.