40#ifndef Foam_IOobjectOption_H
41#define Foam_IOobjectOption_H
109 enum class Layout :
unsigned char
128 bool registerObject_;
256 bool old(registerObject_);
257 registerObject_ = on;
267 bool old(globalObject_);
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).
writeOption writeOpt(writeOption opt) noexcept
Set the write option.
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 registerObject(bool on) noexcept
Change registration preference.
static bool isReadOptional(readOption opt) noexcept
True if (LAZY_READ) bits are set [same as READ_IF_PRESENT].
bool isAnyRead() const noexcept
True if any reading may be required (ie, != NO_READ).
readOption readOpt() const noexcept
Get the read option.
bool & registerObject() noexcept
Access to the register object option.
writeOption writeOpt() const noexcept
Get the write option.
readOption & readOpt() noexcept
Access to the read option.
bool registerObject() const noexcept
Should objects created with this IOobject be registered?
Layout
The layout of the case structure.
@ global
Global case layout (serial locations).
@ regular
Regular case layout, eg processor-local locations.
static readOption lazierRead(readOption opt) noexcept
Downgrade readOption optional (LAZY_READ), leaves NO_READ intact.
constexpr IOobjectOption(bool registerObject, bool globalObject=false) noexcept
Construct (NO_READ, NO_WRITE) with specified register option as bool.
constexpr IOobjectOption(readOption rOpt, writeOption wOpt, bool registerObject, bool globalObject=false) noexcept
Construct from components with specified register option as bool.
static bool isReadRequired(readOption opt) noexcept
True if (MUST_READ | READ_MODIFIED) bits are set.
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].
constexpr IOobjectOption(readOption rOpt, registerOption registerObject=registerOption::REGISTER, bool globalObject=false) noexcept
Construct NO_WRITE with specified read/register options.
bool & globalObject() noexcept
Access to the global object option.
readOption readOpt(readOption opt) noexcept
Set the read option.
writeOption
Enumeration defining write preferences.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
@ AUTO_WRITE
Automatically write from objectRegistry::writeObject().
writeOption & writeOpt() noexcept
Access to the write option.
constexpr IOobjectOption(registerOption registerObject, bool globalObject=false) noexcept
Construct (NO_READ, NO_WRITE) with specified register option.
bool globalObject(bool on) noexcept
Change global-object status.
static bool isAnyRead(readOption opt) noexcept
True if any reading may be required (ie, != NO_READ).