67struct deleteControlDictPtr
69 ~deleteControlDictPtr()
77 debugSwitchesPtr_ =
nullptr;
78 infoSwitchesPtr_ =
nullptr;
79 optimisationSwitchesPtr_ =
nullptr;
84deleteControlDictPtr deleteControlDictPtr_;
111 return eptr->
get<
T>();
145 if (!controlDictPtr_)
147 string controlDictString(
Foam::getEnv(
"FOAM_CONTROLDICT"));
148 if (!controlDictString.empty())
167 "Cannot open controlDict"
175 return *controlDictPtr_;
181 const char* subDictName,
189 if (!eptr || !eptr->
isDict())
192 <<
"debug::switchSet(const char*, dictionary*&):\n"
193 <<
" Cannot find " << subDictName <<
" in dictionary "
195 << std::endl << std::endl;
200 subDictPtr = &(eptr->
dict());
209 return switchSet(
"DebugSwitches", debugSwitchesPtr_);
215 return switchSet(
"InfoSwitches", infoSwitchesPtr_);
221 return switchSet(
"OptimisationSwitches", optimisationSwitchesPtr_);
293 if (!debugObjectsPtr_)
298 return *debugObjectsPtr_;
304 if (!infoObjectsPtr_)
309 return *infoObjectsPtr_;
315 if (!optimisationObjectsPtr_)
320 return *optimisationObjectsPtr_;
326 if (!dimensionSetObjectsPtr_)
331 return *dimensionSetObjectsPtr_;
337 if (!dimensionedConstantObjectsPtr_)
342 return *dimensionedConstantObjectsPtr_;
354 const char *
const message,
398 hashed = debugSwitches;
406 hashed = infoSwitches;
414 hashed = optSwitches;
450 debug::debugSwitches().sortedToc(),
451 debug::infoSwitches().sortedToc(),
452 debug::optimisationSwitches().sortedToc(),
462 debug::debugSwitches().sortedToc(),
475 debug::infoObjects().sortedToc(),
488 debug::optimisationSwitches().sortedToc(),
498 debug::debugObjects().sortedToc(),
499 debug::infoObjects().sortedToc(),
500 debug::optimisationObjects().sortedToc(),
510 debug::debugObjects().sortedToc(),
523 debug::infoObjects().sortedToc(),
536 debug::optimisationObjects().sortedToc(),
T * find(const word &keyword)
Find and return an entry, nullptr on failure.
void append(const word &keyword, T *ptr)
Add to back of dictionary.
bool unset(const Key &key)
Unset the specified key - same as erase.
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
Input from file stream, using an ISstream.
static Ostream & writeDivider(Ostream &os)
Write the standard file section divider.
bool good() const noexcept
True if next operation might succeed.
Input from string buffer, using a ISstream. Always UNCOMPRESSED.
void append(const T &val)
Append an element at the end of the list.
Ostream & writeList(Ostream &os, const label shortLen=0) const
Write List, with line-breaks in ASCII when length exceeds shortLen.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
entry * findEntry(const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
Find for an entry (non-const access) with the given keyword.
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
A keyword and a list of tokens is an 'entry'.
virtual bool isDict() const noexcept
Return true if this entry is a dictionary.
virtual const dictionary & dict() const =0
Return dictionary, if entry is a dictionary.
A keyword and a list of tokens comprise a primitiveEntry. A primitiveEntry can be read,...
Object registry for simpleRegIOobject. Maintains ordering.
Abstract base class for registered object with I/O. Used in debug symbol registration.
runTime controlDict().readEntry("adjustTimeStep"
Template functions to aid in the implementation of demand driven data.
#define SafeFatalIOErrorInFunction(ios, msg)
Report an error message using Foam::FatalIOError.
Functions to search 'etc' directories for configuration files etc.
dictionary & switchSet(const char *subDictName, dictionary *&subDictPtr)
Internal function to lookup a sub-dictionary from controlDict.
int infoSwitch(const char *name, const int deflt=0)
Lookup info switch or add default value.
void listDebugSwitches(const bool unset=false)
List debug switches.
int debugSwitch(const char *name, const int deflt=0)
Lookup debug switch or add default value.
void addDebugObject(const char *name, simpleRegIOobject *obj)
Register debug switch read/write object.
void listSwitches(const bool unset=false)
List debug/info/optimisation switches.
void listRegisteredOptimisationSwitches(const bool unset=false)
List optimisation switches.
simpleObjectRegistry & infoObjects()
Access to registered InfoSwitch objects.
simpleObjectRegistry & dimensionSetObjects()
Access to registered DimensionSets objects.
float floatOptimisationSwitch(const char *name, const float deflt=0)
Lookup optimisation switch or add default value.
void addDimensionedConstantObject(const char *name, simpleRegIOobject *)
Register DimensionedConstant read/write object.
simpleObjectRegistry & dimensionedConstantObjects()
Access to registered DimensionedConstants objects.
dictionary & optimisationSwitches()
The OptimisationSwitches sub-dictionary in the central controlDict(s).
void listRegisteredSwitches(const bool unset=false)
List registered debug/info/optimisation switches.
void listRegisteredDebugSwitches(const bool unset=false)
List debug switches.
void addOptimisationObject(const char *name, simpleRegIOobject *obj)
Register optimisation switch read/write object.
void listOptimisationSwitches(const bool unset=false)
List optimisation switches.
void addInfoObject(const char *name, simpleRegIOobject *obj)
Register info switch read/write object.
dictionary & controlDict()
void listRegisteredInfoSwitches(const bool unset=false)
List info switches.
simpleObjectRegistry & optimisationObjects()
Access to registered OptimisationSwitch objects.
dictionary & infoSwitches()
The InfoSwitches sub-dictionary in the central controlDict(s).
void listInfoSwitches(const bool unset=false)
List info switches.
simpleObjectRegistry & debugObjects()
Access to registered DebugSwitch objects.
int optimisationSwitch(const char *name, const int deflt=0)
Lookup optimisation switch or add default value.
void addDimensionSetObject(const char *name, simpleRegIOobject *obj)
Register DimensionSets read/write object.
dictionary & debugSwitches()
The DebugSwitches sub-dictionary in the central controlDict(s).
string getEnv(const std::string &envName)
Get environment value for given envName.
static void appendNamedEntry(simpleObjectRegistry &obr, const char *name, simpleRegIOobject *obj)
messageStream Info
Information stream (stdout output on master, null elsewhere)
static void listSwitches(const wordList &debugSwitches, const wordList &infoSwitches, const wordList &optSwitches, const bool unset)
static void printStatus(const char *const message, const wordList &list)
bool notNull(const T *ptr)
True if ptr is not a pointer (of type T) to the nullObject.
static T getOrAdd(dictionary &dict, const char *name, const T deflt)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
fileNameList findEtcFiles(const fileName &name, const bool mandatory=false, unsigned short location=0777, const bool findFirst=false)
Search for files from user/group/other etc locations.
void deleteDemandDrivenData(DataPtr &dataPtr)
constexpr char nl
The newline '\n' character (0x0a)
#define forAllReverse(list, i)
Reverse loop across all elements in list.