Go to the documentation of this file.
116 class objectRegistry;
169 static bool bannerEnabled_;
196 bool registerObject_;
205 unsigned char sizeofLabel_;
208 unsigned char sizeofScalar_;
224 const word& objectType,
234 const word& objectType,
270 return bannerEnabled_;
277 bool old(bannerEnabled_);
299 const fileName&
path,
307 template<
class StringType>
320 const std::string& scope,
342 const word& ioName =
""
438 const objectRegistry&
db() const noexcept;
441 const Time&
time() const;
444 inline const word&
name() const noexcept;
453 inline const
string&
note() const noexcept;
456 inline
string&
note() noexcept;
459 virtual
void rename(const word& newName)
553 const
word& typeName,
562 const
word& typeName,
589 const
bool checkType = true,
591 const
bool verbose = true
626 const
word& objectType,
633 inline
bool good() const noexcept;
635 inline
bool bad() const noexcept;
675 inline bool IOobject::isHeaderClassName<void>()
const
682 Ostream&
operator<<(Ostream&
os,
const InfoProxy<IOobject>& ip);
700 ? io.globalFilePath(T::typeName,
search)
701 : io.localFilePath(T::typeName,
search)
static autoPtr< T > New(Args &&... args)
Construct autoPtr of T with forwarding arguments.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
fileCheckTypes
Enumeration defining the file checking options.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
fileName localFilePath(const word &typeName, const bool search=true) const
Helper for filePath that searches locally.
A class for handling words, derived from Foam::string.
static const Enum< fileCheckTypes > fileCheckTypesNames
Names for the fileCheckTypes.
A helper class for outputting values to Ostream.
A class for handling file names.
bool registerObject() const noexcept
Should object created with this IOobject be registered?
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
virtual ~IOobject()=default
Destructor.
const fileName & instance() const noexcept
unsigned labelByteSize() const noexcept
The sizeof (label) in bytes, possibly read from the header.
static void writeHeaderContent(Ostream &os, const IOobject &io, const word &objectType, const dictionary *metaDataDict=nullptr)
bool typeHeaderOk(const bool checkType=true, const bool search=true, const bool verbose=true)
Read header (uses typeFilePath to find file) and check its info.
static Ostream & writeEndDivider(Ostream &os)
Write the standard end file divider.
const fileName & rootPath() const
static bool bannerEnabled() noexcept
Status of output file banner.
bool isHeaderClassName() const
Test if headerClassName() equals Type::typeName.
static fileCheckTypes fileModificationChecking
Type of file modification checking.
static char scopeSeparator
Character for scoping object names (':' or '_')
IOobject(const IOobject &)=default
Copy construct.
const word & headerClassName() const noexcept
Return name of the class name read from header.
TypeName("IOobject")
Declare type-name, virtual type (with debug switch)
fileName objectRelPath() const
The object path relative to the root.
writeOption writeOpt() const noexcept
The write option.
const Time & time() const
Return Time associated with the objectRegistry.
InfoProxy< IOobject > info() const
Return info proxy.
static Ostream & writeBanner(Ostream &os, const bool noSyntaxHint=false)
Write the standard OpenFOAM file/dictionary banner.
objectState
Enumeration defining the valid states of an IOobject.
bool readHeader(Istream &is)
Registry of regIOobjects.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
writeOption
Enumeration defining the write options.
void warnNoRereading() const
Helper: warn that type does not support re-reading.
autoPtr< IOobject > clone(const objectRegistry ®istry) const
Clone resetting registry.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
const fileName & local() const noexcept
const fileName & caseName() const
bool globalObject() const noexcept
Is object same for all processors?
The IOstreamOption is a simple container for options an IOstream can normally have.
autoPtr< IOobject > clone() const
Clone.
static IOobject selectIO(const IOobject &io, const fileName &altFile, const word &ioName="")
Return the IOobject, but also consider an alternative file name.
unsigned scalarByteSize() const noexcept
The sizeof (scalar) in bytes, possibly read from the header.
static bool fileNameComponents(const fileName &path, fileName &instance, fileName &local, word &name)
Split path into instance, local, name components.
static float fileModificationSkew
Time skew (seconds) for file modification checks.
fileName globalFilePath(const word &typeName, const bool search=true) const
Helper for filePath that searches up if in parallel.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
virtual void rename(const word &newName)
Rename.
readOption readOpt() const noexcept
The read option.
void operator=(const IOobject &io)
fileName typeFilePath(const IOobject &io, const bool search=true)
Template function for obtaining local or global filePath.
virtual const dictionary * findMetaData() const noexcept
Return pointer to meta-data (if any) or nullptr.
const word & name() const noexcept
Return name.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
const string & note() const noexcept
Return the optional note.
static Ostream & writeDivider(Ostream &os)
Write the standard file section divider.
word member() const
Return member (name without the extension)
IOstreamOption parseHeader(const dictionary &headerDict)
fileName search(const word &file, const fileName &directory)
Recursively search the given directory for the file.
word group() const
Return group (extension part of name)
bool bad() const noexcept
bool typeGlobal()
Template function for obtaining global vs. local status.
void setBad(const string &s)
Set the object state to bad.
bool good() const noexcept
bool writeHeader(Ostream &os) const
Write header with current type()
readOption
Enumeration defining the read options.
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
static word scopedName(const std::string &scope, const word &name)
Create scope:name or scope_name string.
fileName objectPath() const
The complete path + object name.
fileName path() const
The complete path.
const objectRegistry & db() const noexcept
Return the local objectRegistry.
static int maxFileModificationPolls
Max number of times to poll for file modification changes.