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