40 #ifndef Foam_IOobjectOption_H
41 #define Foam_IOobjectOption_H
120 bool registerObject_;
248 bool old(registerObject_);
249 registerObject_ = on;
259 bool old(globalObject_);
270 return (opt != readOption::NO_READ);
276 return (readOpt_ != readOption::NO_READ);
282 return (opt & readOption::MUST_READ);
288 return (readOpt_ & readOption::MUST_READ);
294 return (opt == readOption::LAZY_READ);
300 return (readOpt_ == readOption::LAZY_READ);
306 return (opt == readOption::NO_READ ? opt : readOption::LAZY_READ);
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
registerOption
Enumeration for use with registerObject(). Values map to bool (false/true)
@ NO_REGISTER
Do not request registration (bool: false)
@ LEGACY_REGISTER
Legacy/default registration request (bool: true)
@ REGISTER
Request registration (bool: true)
constexpr IOobjectOption(readOption rOpt=readOption::NO_READ, writeOption wOpt=writeOption::NO_WRITE, registerOption registerObject=registerOption::REGISTER, bool globalObject=false) noexcept
Default construct (NO_READ, NO_WRITE, REGISTER, non-global) or construct with specified options.
bool isReadOptional() const noexcept
True if (LAZY_READ) bits are set [same as READ_IF_PRESENT].
bool isReadRequired() const noexcept
True if (MUST_READ | READ_MODIFIED) bits are set.
constexpr IOobjectOption(writeOption wOpt, registerOption registerObject=registerOption::REGISTER, bool globalObject=false) noexcept
Construct NO_READ with specified write/register options.
bool globalObject() const noexcept
True if object is treated the same for all processors.
bool isAnyRead() const noexcept
True if any reading may be required (ie, != NO_READ)
readOption readOpt() const noexcept
Get the read option.
writeOption writeOpt() const noexcept
Get the write option.
bool registerObject() const noexcept
Should objects created with this IOobject be registered?
static readOption lazierRead(readOption opt) noexcept
Downgrade readOption optional (LAZY_READ), leaves NO_READ intact.
readOption
Enumeration defining read preferences.
@ NO_READ
Nothing to be read.
@ READ_IF_PRESENT
Reading is optional [identical to LAZY_READ].
@ MUST_READ
Reading required.
@ LAZY_READ
Reading is optional [identical to READ_IF_PRESENT].
writeOption
Enumeration defining write preferences.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject()
@ AUTO_WRITE
Automatically write from objectRegistry::writeObject()