mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
STYLE: manage dictionary inputMode directly within entry class
- The logic for switching input-mode was previously completely encapsulated within the #inputMode directive, but without any programming equivalent. Furthermore, the encapsulation in inputMode made the logic less clear in other places. Exposing the inputMode as an enum with direct access from entry simplifies things a fair bit. - eliminate one level of else/if nesting in entryIO.C for clearer logic - for dictionary function entries, simply use addNamedToMemberFunctionSelectionTable() and avoid defining a type() as a static. For most function entries the information is only used to get a name for the selection table lookup anyhow.
This commit is contained in:
@ -38,22 +38,23 @@ namespace functionEntries
|
||||
{
|
||||
defineTypeNameAndDebug(codeStream, 0);
|
||||
|
||||
addToMemberFunctionSelectionTable
|
||||
addNamedToMemberFunctionSelectionTable
|
||||
(
|
||||
functionEntry,
|
||||
codeStream,
|
||||
execute,
|
||||
dictionaryIstream
|
||||
dictionaryIstream,
|
||||
codeStream
|
||||
);
|
||||
|
||||
addToMemberFunctionSelectionTable
|
||||
addNamedToMemberFunctionSelectionTable
|
||||
(
|
||||
functionEntry,
|
||||
codeStream,
|
||||
execute,
|
||||
primitiveEntryIstream
|
||||
primitiveEntryIstream,
|
||||
codeStream
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -175,7 +176,7 @@ Foam::functionEntries::codeStream::getFunction
|
||||
// create library if required
|
||||
if (!lib)
|
||||
{
|
||||
bool create =
|
||||
const bool create =
|
||||
Pstream::master()
|
||||
|| (regIOobject::fileModificationSkew <= 0); // not NFS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user