41 #ifndef Foam_regIOobject_H 42 #define Foam_regIOobject_H 58 namespace functionEntries
62 namespace fileOperations
64 class uncollatedFileOperation;
96 bool ownedByRegistry_;
117 void readStream(
const bool readOnProc);
196 inline static Type&
store(Type*
p);
226 inline static Type&
store(
tmp<Type>& ptr);
232 inline static Type&
store(
tmp<Type>&& ptr);
312 Istream& readStream(const
word&, const
bool readOnProc = true);
353 const
bool writeOnProc
357 virtual
bool write(const
bool writeOnProc = true) const;
363 virtual
bool global()
const 385 const
bool writeOnProc
bool upToDate(const regIOobject &) const
Return true if up-to-date with respect to given object.
A class for handling file names.
void release(const bool unregister=false) noexcept
Set object as not ownedByRegistry.
dictionary & getMetaData() noexcept
Get or create meta-data.
virtual bool read()
Read object.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
void setUpToDate()
Set as up-to-date.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
label eventNo() const noexcept
Event number at last update.
regIOobject(const IOobject &io, const bool isTimeObject=false)
Construct from IOobject. The optional flag adds special handling if the object is the top-level regIO...
virtual void updateMetaData()
Update internal meta-data (eg, prior to writing)
bool headerOk()
Read and check header info. Does not check the headerClassName.
TypeName("regIOobject")
Runtime type information.
bool store()
Register object with its registry and transfer ownership to the registry.
virtual fileName filePath() const
Return complete path + object name if the file exists.
A simple container for options an IOstream can normally have.
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc) const
Write using stream options.
void removeMetaData()
Remove meta-data.
A class for managing references or pointers (no reference counting)
fileOperation that assumes file operations are local.
class FOAM_DEPRECATED_FOR(2017-05, "Foam::Enum") NamedEnum
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
Dictionary entry that contains C++ OpenFOAM code that is compiled to generate the entry itself...
void close()
Close Istream.
A class for handling words, derived from Foam::string.
virtual bool readIfModified()
Read object if modified (as set by call to modified)
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
#define FOAM_DEPRECATED_STRICT(since, replacement)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
const labelList & watchIndices() const noexcept
Read access to file-monitoring handles.
bool checkOut()
Remove all file watches and remove object from registry.
const dictionary * findMetaData() const noexcept
Return pointer to meta-data or nullptr.
virtual void addWatch()
Add file watch on object (if registered and READ_IF_MODIFIED)
virtual void rename(const word &newName)
Rename.
virtual bool global() const
Is object global.
static bool masterOnlyReading
To flag master-only reading of objects.
virtual bool readData(Istream &)
Virtual readData function.
void operator=(const regIOobject &)=delete
No copy assignment.
bool ownedByRegistry() const noexcept
Is this object owned by the registry?
virtual bool modified() const
Return true if the object's file (or files for objectRegistry) have been modified. (modified state is cached by Time)
streamFormat
Data format (ascii | binary)
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
A class for managing temporary objects.
virtual bool writeData(Ostream &) const =0
Pure virtual writeData function.
Defines the attributes of an object for which implicit objectRegistry management is supported...
bool checkIn()
Add object to registry, if not already registered.
bool readHeaderOk(const IOstreamOption::streamFormat fmt, const word &typeName)
Helper: check readOpt flags and read if necessary.
bool registered() const noexcept
Query the registered state (ie, has been checked in). This is not necessarily the same as registerObj...
virtual ~regIOobject()
Destructor.