mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: refactor IOobject options
- IOobjectOption class encapsulates read/write, storage flags for
lightweight handling, independent of objectRegistry etc.
ENH: add IOobject isReadRequired() and isReadOptional() queries
- encapsulates test of MUST_READ, MUST_READ_IF_MODIFIED,
READ_IF_PRESENT for convenience / less clutter.
Example,
if (isReadRequired() || (isReadOptional() && headerOk()))
{
...
}
Instead of
if
(
(
readOpt() == IOobject::MUST_READ
|| readOpt() == IOobject::MUST_READ_IF_MODIFIED
)
|| (readOpt() == IOobject::READ_IF_PRESENT && headerOk())
)
{
...
}
This commit is contained in:
@ -2626,12 +2626,7 @@ Foam::distributedTriSurfaceMesh::distributedTriSurfaceMesh(const IOobject& io)
|
||||
searchableSurface::local(),
|
||||
searchableSurface::db(),
|
||||
(
|
||||
(
|
||||
searchableSurface::readOpt()
|
||||
== IOobject::MUST_READ
|
||||
|| searchableSurface::readOpt()
|
||||
== IOobject::MUST_READ_IF_MODIFIED
|
||||
)
|
||||
searchableSurface::isReadRequired()
|
||||
? IOobject::READ_IF_PRESENT
|
||||
: searchableSurface::readOpt()
|
||||
),
|
||||
@ -2739,12 +2734,7 @@ Foam::distributedTriSurfaceMesh::distributedTriSurfaceMesh
|
||||
searchableSurface::local(),
|
||||
searchableSurface::db(),
|
||||
(
|
||||
(
|
||||
searchableSurface::readOpt()
|
||||
== IOobject::MUST_READ
|
||||
|| searchableSurface::readOpt()
|
||||
== IOobject::MUST_READ_IF_MODIFIED
|
||||
)
|
||||
searchableSurface::isReadRequired()
|
||||
? IOobject::READ_IF_PRESENT
|
||||
: searchableSurface::readOpt()
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user