Go to the documentation of this file.
39 #ifndef objectRegistry_H
40 #define objectRegistry_H
85 bool parentNotTime()
const;
89 template<
class MatchPredicate1,
class MatchPredicate2>
90 static label countImpl
93 const MatchPredicate1& matchClass,
94 const MatchPredicate2& matchName
99 template<
class Type,
class MatchPredicate>
100 static label countTypeImpl
103 const MatchPredicate& matchName
107 template<
class MatchPredicate>
111 const MatchPredicate& matchName
115 template<
class MatchPredicate1,
class MatchPredicate2>
119 const MatchPredicate1& matchClass,
120 const MatchPredicate2& matchName,
125 template<
class Type,
class MatchPredicate>
129 const MatchPredicate& matchName,
151 const bool recursive =
false
213 template<
class MatchPredicate>
221 label
count(
const char* clsName)
const;
225 template<
class MatchPredicate>
226 label
count(
const MatchPredicate& matchClass)
const;
230 template<
class MatchPredicate1,
class MatchPredicate2>
233 const MatchPredicate1& matchClass,
234 const MatchPredicate2& matchName
246 label
count(
const bool strict =
false)
const;
252 template<
class Type,
class MatchPredicate>
253 label
count(
const MatchPredicate& matchName)
const;
267 template<
class MatchPredicate>
273 template<
class MatchPredicate1,
class MatchPredicate2>
276 const MatchPredicate1& matchClass,
277 const MatchPredicate2& matchName
290 template<
class Type,
class MatchPredicate>
305 template<
class MatchPredicate>
311 template<
class MatchPredicate1,
class MatchPredicate2>
314 const MatchPredicate1& matchClass,
315 const MatchPredicate2& matchName
328 template<
class Type,
class MatchPredicate>
341 const bool forceCreate =
false,
342 const bool recursive =
false
362 bool found(
const word&
name,
const bool recursive =
false)
const;
372 const bool recursive =
false
384 const bool recursive =
false
396 const bool recursive =
false
408 const bool recursive =
false
422 const bool recursive =
false
433 const bool recursive =
false
444 const bool recursive =
false
484 bool erase(
const iterator& iter);
494 label
erase(std::initializer_list<word>
keys);
544 bool recursive = false
547 return this->cfindObject<Type>(
name, recursive);
557 bool recursive = false
560 return this->getObjectPtr<Type>(
name, recursive);
Type * getObjectPtr(const word &name, const bool recursive=false) const
virtual bool readIfModified()
Read object if modified.
wordList sortedNames() const
The sorted names of all objects.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
virtual ~objectRegistry()
Destructor, with checkOut() for all objects that are ownedByRegistry.
virtual bool writeData(Ostream &) const
writeData function required by regIOobject but not used.
label getEvent() const
Return new event number.
Type * lookupObjectRefPtr(const word &name, bool recursive=false) const
Deprecated(2018-10) get object pointer, ignoring constness.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
const word & name() const
Return name.
A class for handling words, derived from Foam::string.
A class for handling file names.
TypeName("objectRegistry")
Declare type name for this IOobject.
const Time & time() const
Return time.
void clearStorage()
Clear all entries from the registry and the table itself.
bool checkIn()
Add object to registry, if not already registered.
void clear()
Clear all entries from the registry.
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?
const objectRegistry & db() const
Return the local objectRegistry.
Registry of regIOobjects.
HashTable< const Type * > lookupClass(const bool strict=false) const
Return all objects with a class satisfying isA<Type>
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
virtual const fileName & dbDir() const
Local directory path of this objectRegistry relative to the time.
virtual void rename(const word &newName)
Rename.
HashTable< wordHashSet > classes() const
A summary hash of classes used and their associated object names.
The IOstreamOption is a simple container for options an IOstream can normally have.
const Type & lookupObject(const word &name, const bool recursive=false) const
virtual bool writeObject(IOstreamOption streamOpt, const bool valid) const
Write the objects using stream options.
bool found(const word &name, const bool recursive=false) const
Can the regIOobject object be found (by name).
A HashTable similar to std::unordered_map.
Type & lookupObjectRef(const word &name, const bool recursive=false) const
virtual bool modified() const
Return true if any of the object's files have been modified.
void readModifiedObjects()
Read the objects that have been modified.
const objectRegistry & thisDb() const
Return the object registry.
const_iterator_pair< const_key_iterator, this_type > keys() const
A const iterator begin/end pair for iterating over keys.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
bool erase(const iterator &iter)
Erase an entry specified by the given iterator.
const Type * findObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
bool checkOut()
Remove all file watches and remove object from registry.
const Type * cfindObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
const objectRegistry & parent() const
Return the parent objectRegistry.
wordList names() const
The names of all objects.
const objectRegistry & subRegistry(const word &name, const bool forceCreate=false, const bool recursive=false) const
Lookup and return a const sub-objectRegistry.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
class FOAM_DEPRECATED_FOR(2017-05, "Foam::Enum") NamedEnum
Operations on lists of strings.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
label count(const char *clsName) const
The number of objects of the given class name.