43#ifndef Foam_regIOobject_H
44#define Foam_regIOobject_H
66 class uncollatedFileOperation;
98 bool ownedByRegistry_;
119 void readStream(
const bool readOnProc);
145 regIOobject(
const IOobject&
io,
const bool isTimeObject =
false);
198 inline static Type&
store(Type*
p);
204 inline static Type&
store(std::unique_ptr<Type>&& ptr);
234 inline static Type&
store(
tmp<Type>& ptr);
240 inline static Type&
store(
tmp<Type>&& ptr);
320 Istream& readStream(const
word&, const
bool readOnProc = true);
361 const
bool writeOnProc
365 virtual
bool write(const
bool writeOnProc = true) const;
371 virtual
bool global()
const
393 const
bool writeOnProc
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.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
A simple container for options an IOstream can normally have.
streamFormat
Data format (ascii | binary | coherent).
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A class for handling file names.
fileOperation that assumes file operations are local.
Dictionary entry that contains C++ OpenFOAM code that is compiled to generate the entry itself....
A class for managing references or pointers (no reference counting).
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc) const
Write using stream options.
const dictionary * findMetaData() const noexcept
Return pointer to meta-data or nullptr.
bool registered() const noexcept
Query the registered state (ie, has been checked in). This is not necessarily the same as registerObj...
virtual bool writeData(Ostream &) const =0
Pure virtual writeData function.
void setUpToDate()
Set as up-to-date.
virtual bool modified() const
Return true if the object's file (or files for objectRegistry) have been modified....
virtual bool global() const
Is object global.
void close()
Close Istream.
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 fileName filePath() const
Return complete path + object name if the file exists.
virtual void updateMetaData()
Update internal meta-data (eg, prior to writing).
const labelList & watchIndices() const noexcept
Read access to file-monitoring handles.
bool ownedByRegistry() const noexcept
Is this object owned by the registry?
bool upToDate(const regIOobject &) const
Return true if up-to-date with respect to given object.
static bool masterOnlyReading
To flag master-only reading of objects.
TypeName("regIOobject")
Runtime type information.
bool headerOk()
Read and check header info. Does not check the headerClassName.
virtual bool readIfModified()
Read object if modified (as set by call to modified).
void removeMetaData()
Remove meta-data.
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
bool store()
Register object with its registry and transfer ownership to the registry.
label eventNo() const noexcept
Event number at last update.
virtual bool readData(Istream &)
Virtual readData function.
bool checkOut()
Remove object from registry, and remove all file watches.
void operator=(const regIOobject &)=delete
No copy assignment.
virtual ~regIOobject()
Destructor.
virtual void addWatch()
Add file watch on object (if registered and READ_IF_MODIFIED).
dictionary & getMetaData() noexcept
Get or create meta-data.
bool readHeaderOk(const IOstreamOption::streamFormat fmt, const word &typeName)
Helper: check readOpt flags and read if necessary.
void release(const bool unregister=false) noexcept
Set object as not ownedByRegistry.
virtual void rename(const word &newName)
Rename.
virtual bool read()
Read object.
bool checkIn()
Add object to registry, if not already registered.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
Namespace for implementations of a fileOperation.
Namespace for containing a functionEntry.
List< label > labelList
A List of labels.
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
class FOAM_DEPRECATED_FOR(2017-05, "Foam::Enum") NamedEnum
#define FOAM_DEPRECATED_STRICT(since, replacement)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.