Go to the documentation of this file.
39 #ifndef objectRegistry_H
40 #define objectRegistry_H
85 bool parentNotTime()
const noexcept;
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,
202 template<
class MatchPredicate>
210 label
count(
const char* clsName)
const;
214 template<
class MatchPredicate>
215 label
count(
const MatchPredicate& matchClass)
const;
219 template<
class MatchPredicate1,
class MatchPredicate2>
222 const MatchPredicate1& matchClass,
223 const MatchPredicate2& matchName
235 label
count(
const bool strict =
false)
const;
241 template<
class Type,
class MatchPredicate>
242 label
count(
const MatchPredicate& matchName)
const;
256 template<
class MatchPredicate>
262 template<
class MatchPredicate1,
class MatchPredicate2>
265 const MatchPredicate1& matchClass,
266 const MatchPredicate2& matchName
279 template<
class Type,
class MatchPredicate>
294 template<
class MatchPredicate>
300 template<
class MatchPredicate1,
class MatchPredicate2>
303 const MatchPredicate1& matchClass,
304 const MatchPredicate2& matchName
317 template<
class Type,
class MatchPredicate>
330 const bool forceCreate =
false,
331 const bool recursive =
false
355 const bool recursive =
false
361 bool found(
const word&
name,
const bool recursive =
false)
const;
371 const bool recursive =
false
383 const bool recursive =
false
395 const bool recursive =
false
407 const bool recursive =
false
421 const bool recursive =
false
432 const bool recursive =
false
443 const bool recursive =
false
483 bool erase(
const iterator& iter);
493 label
erase(std::initializer_list<word>
keys);
543 bool recursive = false
546 return this->cfindObject<Type>(
name, recursive);
556 bool recursive = false
559 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.
A class for handling words, derived from Foam::string.
A class for handling file names.
bool isTimeDb() const noexcept
True if the registry is Time.
TypeName("objectRegistry")
Declare type name for this IOobject.
void clearStorage()
Clear all entries from the registry and the table itself.
const objectRegistry & parent() const noexcept
Return the parent objectRegistry.
bool checkIn()
Add object to registry, if not already registered.
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
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?
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.
const objectRegistry & thisDb() const noexcept
Return the object registry.
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 regIOobject * cfindIOobject(const word &name, const bool recursive=false) const
Return const pointer to the regIOobject.
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_iterator_pair< const_key_iterator, this_type > keys() const
A const iterator begin/end pair for iterating over keys.
const word & name() const noexcept
Return name.
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.
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.
const Time & time() const noexcept
Return time registry.
const objectRegistry & db() const noexcept
Return the local objectRegistry.