39#ifndef Foam_objectRegistry_H
40#define Foam_objectRegistry_H
86 bool parentNotTime()
const noexcept;
90 template<
class MatchPredicate1,
class MatchPredicate2>
91 static label countImpl
94 const MatchPredicate1& matchClass,
95 const MatchPredicate2& matchName
100 template<
class Type,
class MatchPredicate>
101 static label countTypeImpl
104 const MatchPredicate& matchName
108 template<
class MatchPredicate>
112 const MatchPredicate& matchName
116 template<
class MatchPredicate1,
class MatchPredicate2>
120 const MatchPredicate1& matchClass,
121 const MatchPredicate2& matchName,
126 template<
class Type,
class MatchPredicate>
130 const MatchPredicate& matchName,
136 template<
class Type,
class MatchPredicate>
140 const MatchPredicate& matchName
212 template<
class MatchPredicate>
248 template<
class Type,
class MatchPredicate>
254 template<
class Type,
class MatchPredicate>
260 template<
class Type,
class MatchPredicate>
268 label
count(
const char* clsName)
const;
272 template<
class MatchPredicate>
273 label
count(
const MatchPredicate& matchClass)
const;
277 template<
class MatchPredicate1,
class MatchPredicate2>
280 const MatchPredicate1& matchClass,
281 const MatchPredicate2& matchName
293 label
count(
const bool strict =
false)
const;
299 template<
class Type,
class MatchPredicate>
300 label
count(
const MatchPredicate& matchName)
const;
314 template<
class MatchPredicate>
320 template<
class MatchPredicate1,
class MatchPredicate2>
323 const MatchPredicate1& matchClass,
324 const MatchPredicate2& matchName
337 template<
class Type,
class MatchPredicate>
352 template<
class MatchPredicate>
358 template<
class MatchPredicate1,
class MatchPredicate2>
361 const MatchPredicate1& matchClass,
362 const MatchPredicate2& matchName
375 template<
class Type,
class MatchPredicate>
388 const bool forceCreate =
false,
389 const bool recursive =
false
413 const bool recursive =
false
419 bool found(
const word&
name,
const bool recursive =
false)
const;
429 const bool recursive =
false
441 const bool recursive =
false
453 const bool recursive =
false
465 const bool recursive =
false
479 const bool recursive =
false
490 const bool recursive =
false
501 const bool recursive =
false
541 bool erase(
const iterator& iter);
551 label
erase(std::initializer_list<word>
keys);
601 bool recursive = false
604 return this->cfindObject<Type>(
name, recursive);
614 bool recursive = false
617 return this->getObjectPtr<Type>(
name, recursive);
A HashTable similar to std::unordered_map.
const_iterator_pair< const_key_iterator, this_type > keys() const
A const iterator begin/end pair for iterating over keys.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const word & name() const noexcept
Return the object name.
const objectRegistry & db() const noexcept
Return the local objectRegistry.
The IOstreamOption is a simple container for options an IOstream can normally have.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
A class for handling file names.
Registry of regIOobjects.
label count(const MatchPredicate &matchClass) const
The number of objects of the given class name.
UPtrList< const regIOobject > sorted() const
Return sorted list of objects.
wordList sortedNames(const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName) const
label count(const MatchPredicate &matchName) const
UPtrList< Type > sorted()
Return sorted list of objects with a class satisfying isA<Type>
const Type * lookupObjectPtr(const word &name, bool recursive=false) const
Deprecated(2018-10) find object.
bool foundObject(const word &name, const bool recursive=false) const
Is the named Type found?
wordList sortedNames() const
The sorted names of all objects.
virtual const fileName & dbDir() const
Local directory path of this objectRegistry relative to the time.
const objectRegistry & parent() const noexcept
Return the parent objectRegistry.
wordList names(const MatchPredicate &matchClass) const
The unsorted names of objects with a matching class name.
virtual bool modified() const
Return true if any of the object's files have been modified.
bool isTimeDb() const noexcept
True if the registry is Time.
UPtrList< const Type > csorted(const MatchPredicate &matchName) const
HashTable< wordHashSet > classes() const
A summary hash of classes used and their associated object names.
UPtrList< Type > sorted(const MatchPredicate &matchName)
virtual ~objectRegistry()
Destructor, with checkOut() for all objects that are ownedByRegistry.
TypeName("objectRegistry")
Declare type name for this IOobject.
const Time & time() const noexcept
Return time registry.
void clearStorage()
Clear all entries from the registry and the table itself.
label count(const bool strict=false) const
The names of objects with a class satisfying isA<Type>
wordList names(const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName) const
wordList names(const MatchPredicate &matchName) const
UPtrList< const Type > csorted() const
Return sorted list of objects with a class satisfying isA<Type>
wordList names() const
The unsorted names of objects with a class satisfying isA<Type>.
Type * lookupObjectRefPtr(const word &name, bool recursive=false) const
Deprecated(2018-10) get object pointer, ignoring constness.
HashTable< wordHashSet > classes(const MatchPredicate &matchName) const
UPtrList< const Type > sorted(const MatchPredicate &matchName) const
virtual bool writeObject(IOstreamOption streamOpt, const bool valid) const
Write the objects using stream options.
wordList sortedNames(const MatchPredicate &matchName) const
wordList sortedNames() const
The sorted names of objects with a class satisfying isA<Type>
HashTable< const Type * > lookupClass(const bool strict=false) const
Return all objects with a class satisfying isA<Type>
const regIOobject * cfindIOobject(const word &name, const bool recursive=false) const
Return const pointer to the regIOobject.
virtual bool readIfModified()
Read object if modified.
virtual bool writeData(Ostream &) const
writeData function required by regIOobject but not used.
HashTable< Type * > lookupClass(const bool strict=false)
Return all objects with a class satisfying isA<Type>
const objectRegistry & thisDb() const noexcept
Return the object registry.
bool erase(const iterator &iter)
Erase an entry specified by the given iterator.
const objectRegistry & subRegistry(const word &name, const bool forceCreate=false, const bool recursive=false) const
Lookup and return a const sub-objectRegistry.
wordList sortedNames(const MatchPredicate &matchClass) const
The sorted names objects with a matching class name.
void clear()
Clear all entries from the registry.
UPtrList< const regIOobject > csorted() const
Return sorted list of objects.
const Type * cfindObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
void readModifiedObjects()
Read the objects that have been modified.
Type & lookupObjectRef(const word &name, const bool recursive=false) const
wordList names() const
The unsorted names of all objects.
label count(const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName) const
The number of objects of the given class name.
const Type * findObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
label count(const char *clsName) const
The number of objects of the given class name.
UPtrList< const Type > sorted() const
Return sorted list of objects with a class satisfying isA<Type>
const Type & lookupObject(const word &name, const bool recursive=false) const
virtual void rename(const word &newName)
Rename.
label getEvent() const
Return new event number.
Type * getObjectPtr(const word &name, const bool recursive=false) const
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
bool checkOut()
Remove all file watches and remove object from registry.
bool checkIn()
Add object to registry, if not already registered.
A class for handling words, derived from Foam::string.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
#define FOAM_DEPRECATED_FOR(since, replacement)
Operations on lists of strings.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.