objectRegistry.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2019 OpenFOAM Foundation
9  Copyright (C) 2016-2023 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::objectRegistry
29 
30 Description
31  Registry of regIOobjects
32 
33 SourceFiles
34  objectRegistry.C
35  objectRegistryTemplates.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef Foam_objectRegistry_H
40 #define Foam_objectRegistry_H
41 
42 #include "HashTable.H"
43 #include "HashSet.H"
44 #include "UPtrList.H"
45 #include "regIOobject.H"
46 #include "wordRes.H"
47 #include "Pair.H"
48 
49 // Historically included by objectRegistryTemplates (until NOV-2018),
50 // but not used by objectRegistry directly.
51 // Leave here for now to avoid a missing include in other bits of code.
52 #include "stringListOps.H"
53 
54 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 
56 namespace Foam
57 {
58 
59 /*---------------------------------------------------------------------------*\
60  Class objectRegistry Declaration
61 \*---------------------------------------------------------------------------*/
62 
63 class objectRegistry
64 :
65  public regIOobject,
66  public HashTable<regIOobject*>
67 {
68  // Private Data
69 
70  //- Master time objectRegistry
71  const Time& time_;
72 
73  //- Parent objectRegistry
74  const objectRegistry& parent_;
75 
76  //- Local directory path of this objectRegistry relative to time
77  fileName dbDir_;
78 
79  //- Current event
80  mutable label event_;
81 
82  //- State of cacheTemporaryObjects_, set true after reading
83  mutable bool cacheTemporaryObjectsActive_;
84 
85  //- Names of temporary object with current state
86  mutable HashTable<Pair<bool>> cacheTemporaryObjects_;
87 
88  //- Accumulated list of temporary objects available to cache
89  // Used to provide diagnostics in case the requested object is not
90  // available
91  mutable wordHashSet temporaryObjects_;
92 
93 
94  // Private Member Functions
95 
96  //- Is the objectRegistry parent_ different from time_
97  // Used to terminate searching within the ancestors
98  bool parentNotTime() const noexcept;
99 
100  //- Read the cacheTemporaryObjects list from Time controlDict
101  void readCacheTemporaryObjects() const;
102 
103  //- Delete the cached object. Eg, before caching a new object
104  //- A nullptr is ignored.
105  void deleteCachedObject(regIOobject* io) const;
106 
107  //- Templated implementation for count()
108  // The number of items with a matching class
109  template<class MatchPredicate1, class MatchPredicate2>
110  static label countImpl
111  (
112  const objectRegistry& list,
113  const MatchPredicate1& matchClass,
114  const MatchPredicate2& matchName
115  );
116 
117  //- Templated implementation for count()
118  // The number of items with a matching class
119  template<class Type, class MatchPredicate>
120  static label countTypeImpl
121  (
122  const objectRegistry& list,
123  const MatchPredicate& matchName
124  );
125 
126  //- Templated implementation for classes()
127  template<class MatchPredicate>
128  static HashTable<wordHashSet> classesImpl
129  (
130  const objectRegistry& list,
131  const MatchPredicate& matchName
132  );
133 
134  //- Templated implementation for names(), sortedNames()
135  template<class MatchPredicate1, class MatchPredicate2>
136  static wordList namesImpl
137  (
138  const objectRegistry& list,
139  const MatchPredicate1& matchClass,
140  const MatchPredicate2& matchName,
141  const bool doSort
142  );
143 
144  //- Templated implementation for names(), sortedNames()
145  template<class Type, class MatchPredicate>
146  static wordList namesTypeImpl
147  (
148  const objectRegistry& list,
149  const MatchPredicate& matchName,
150  const bool doSort
151  );
152 
153  //- Templated implementation for sorted()
154  // Called with 'Type' or 'const Type'
155  template<class Type, class MatchPredicate>
156  static UPtrList<Type> objectsTypeImpl
157  (
158  const objectRegistry& list,
159  const MatchPredicate& matchName
160  );
161 
162 
163  //- No copy construct
164  objectRegistry(const objectRegistry&) = delete;
165 
166  //- No copy assignment
167  void operator=(const objectRegistry&) = delete;
168 
169 
170 public:
171 
172  //- Declare type name for this IOobject
173  TypeName("objectRegistry");
174 
175 
176  // Constructors
177 
178  //- Construct the time objectRegistry,
179  //- with estimated table capacity (default: 128)
180  explicit objectRegistry(const Time& db, const label nObjects=128);
181 
182  //- Construct sub-registry given an IObject to describe the registry,
183  //- with estimated table capacity (default: 128)
184  explicit objectRegistry(const IOobject& io, const label nObjects=128);
185 
186 
187  //- Destructor, with checkOut() for all objects that are ownedByRegistry
188  virtual ~objectRegistry();
189 
190 
191  // Member Functions
192 
193  // Access
194 
195  //- Return the object registry
196  const objectRegistry& thisDb() const noexcept
197  {
198  return *this;
199  }
200 
201  //- Return the parent objectRegistry
202  const objectRegistry& parent() const noexcept
203  {
204  return parent_;
205  }
206 
207  //- Return time registry
208  const Time& time() const noexcept
209  {
210  return time_;
211  }
212 
213  //- True if the registry is Time
214  bool isTimeDb() const noexcept;
215 
216  //- Local directory path of this objectRegistry relative to the time
217  virtual const fileName& dbDir() const
218  {
219  return dbDir_;
220  }
221 
222 
223  // Summary of classes
224 
225  //- A summary hash of classes used and their associated object names.
226  // Behaviour and usage as per IOobjectList::classes
228 
229  //- A summary hash of classes used and their associated object names,
230  //- restricted to objects that have a matching object name.
231  template<class MatchPredicate>
232  HashTable<wordHashSet> classes(const MatchPredicate& matchName) const;
233 
234 
235  // Sorted access
236 
237  //- Return sorted list of objects
238  // The lifetime of the returned content cannot exceed the parent!
240 
241  //- Return sorted list of objects
242  // The lifetime of the returned content cannot exceed the parent!
244 
245  //- Return sorted list of objects
246  // The lifetime of the returned content cannot exceed the parent!
248 
249  //- Return sorted list of objects with a class satisfying \c isA<Type>
250  // The lifetime of the returned content cannot exceed the parent!
251  template<class Type>
253 
254  //- Return sorted list of objects with a class satisfying \c isA<Type>
255  // The lifetime of the returned content cannot exceed the parent!
256  template<class Type>
259  //- Return sorted list of objects with a class satisfying \c isA<Type>
260  // The lifetime of the returned content cannot exceed the parent!
261  template<class Type>
263 
264  //- Return sorted list of objects with a class satisfying \c isA<Type>
265  //- that also have a matching object name.
266  // The lifetime of the returned content cannot exceed the parent!
267  template<class Type, class MatchPredicate>
268  UPtrList<const Type> csorted(const MatchPredicate& matchName) const;
269 
270  //- Return sorted list of objects with a class satisfying \c isA<Type>
271  //- that also have a matching object name.
272  // The lifetime of the returned content cannot exceed the parent!
273  template<class Type, class MatchPredicate>
274  UPtrList<const Type> sorted(const MatchPredicate& matchName) const;
275 
276  //- Return sorted list of objects with a class satisfying \c isA<Type>
277  //- that also have a matching object name.
278  // The lifetime of the returned content cannot exceed the parent!
279  template<class Type, class MatchPredicate>
280  UPtrList<Type> sorted(const MatchPredicate& matchName);
281 
282 
283  // Number of items
284 
285  //- The number of objects of the given class name
286  // \note uses the class type() method
287  label count(const char* clsName) const;
288 
289  //- The number of objects of the given class name
290  // \note uses the class type() method
291  template<class MatchPredicate>
292  label count(const MatchPredicate& matchClass) const;
293 
294  //- The number of objects of the given class name
295  // \note uses the class type() method
296  template<class MatchPredicate1, class MatchPredicate2>
297  label count
298  (
299  const MatchPredicate1& matchClass,
300  const MatchPredicate2& matchName
301  ) const;
302 
303  //- The names of objects with a class satisfying \c isA<Type>
304  //
305  // \param strict use \c isType<Type> instead of \c isA<Type>
306  //
307  // \note The values of \c count<Type>() and \c count(Type::typeName)
308  // may be inconsistent, since they use different mechanisms for
309  // testing the class type.
310  // \note If \a Type is \c void, no isA check is used (always true).
311  template<class Type>
312  label count(const bool strict = false) const;
313 
314  //- The names of objects with a class satisfying \c isA<Type>
315  //- that also have a matching object name.
316  //
317  // \note If \a Type is \c void, no isA check is used (always true).
318  template<class Type, class MatchPredicate>
319  label count(const MatchPredicate& matchName) const;
320 
321 
322  // Summary of names
323 
324  //- The unsorted names of all objects
325  wordList names() const;
326 
327  //- The unsorted names of objects with the given class name.
328  // \note uses the class type() method
329  wordList names(const char* clsName) const;
330 
331  //- The unsorted names of objects with a matching class name
332  // \note uses the class type() method
333  template<class MatchPredicate>
334  wordList names(const MatchPredicate& matchClass) const;
335 
336  //- The unsorted names of objects with a matching class name
337  //- that also have a matching object name.
338  // \note uses the class type() method
339  template<class MatchPredicate1, class MatchPredicate2>
341  (
342  const MatchPredicate1& matchClass,
343  const MatchPredicate2& matchName
344  ) const;
345 
346  //- The unsorted names of objects with a class satisfying \c isA<Type>.
347  //
348  // \note If \a Type is \c void, no isA check is used (always true).
349  template<class Type>
350  wordList names() const;
351 
352  //- The unsorted names of objects with a class satisfying \c isA<Type>
353  //- that also have a matching object name.
354  //
355  // \note If \a Type is \c void, no isA check is used (always true).
356  template<class Type, class MatchPredicate>
357  wordList names(const MatchPredicate& matchName) const;
358 
359 
360  // Summary of names (sorted)
361 
362  //- The sorted names of all objects
363  wordList sortedNames() const;
364 
365  //- The sorted names of objects with the given class name.
366  // \note uses the class type() method
367  wordList sortedNames(const char* clsName) const;
368 
369  //- The sorted names objects with a matching class name
370  // \note uses the class type() method
371  template<class MatchPredicate>
372  wordList sortedNames(const MatchPredicate& matchClass) const;
373 
374  //- The sorted names of objects with a matching class name
375  //- that also have a matching object name.
376  // \note uses the class type() method
377  template<class MatchPredicate1, class MatchPredicate2>
379  (
380  const MatchPredicate1& matchClass,
381  const MatchPredicate2& matchName
382  ) const;
383 
384  //- The sorted names of objects with a class satisfying \c isA<Type>
385  //
386  // \note If \a Type is \c void, no isA check is used (always true).
387  template<class Type>
388  wordList sortedNames() const;
389 
390  //- The sorted names of objects with a class satisfying \c isA<Type>
391  //- that also have a matching object name.
392  //
393  // \note If \a Type is \c void, no isA check is used (always true).
394  template<class Type, class MatchPredicate>
395  wordList sortedNames(const MatchPredicate& matchName) const;
396 
397 
398  // Lookup
399 
400  //- Lookup and return a const sub-objectRegistry.
401  //
402  // \param forceCreate create it if it does not exist.
403  // \param recursive search parent registries.
405  (
406  const word& name,
407  const bool forceCreate = false,
408  const bool recursive = false
409  ) const;
410 
411 
412  //- Return all objects with a class satisfying \c isA<Type>
413  //
414  // \param strict use \c isType<Type> instead of \c isA<Type>
415  template<class Type>
416  HashTable<const Type*> lookupClass(const bool strict = false) const;
417 
418  //- Return all objects with a class satisfying \c isA<Type>
419  //
420  // \param strict use \c isType<Type> instead of \c isA<Type>
421  template<class Type>
422  HashTable<Type*> lookupClass(const bool strict = false);
423 
424  //- Return const pointer to the regIOobject.
425  //
426  // \param recursive search parent registries
427  //
428  // \return nullptr if the object was not found.
430  (
431  const word& name,
432  const bool recursive = false
433  ) const;
434 
435  //- Does the registry contain the regIOobject object (by name).
436  //
437  // \param name the object name
438  // \param recursive search parent registries
439  bool contains(const word& name, const bool recursive = false) const;
440 
441  //- Is the named Type found?
442  //
443  // \param recursive search parent registries
444  template<class Type>
445  bool foundObject
446  (
447  const word& name,
448  const bool recursive = false
449  ) const;
450 
451  //- Return const pointer to the object of the given Type.
452  //
453  // \param recursive search parent registries
454  //
455  // \return nullptr if the object was not found or had incorrect type.
456  template<class Type>
457  const Type* cfindObject
458  (
459  const word& name,
460  const bool recursive = false
461  ) const;
462 
463  //- Return const pointer to the object of the given Type.
464  //
465  // \param recursive search parent registries
466  //
467  // \return nullptr if the object was not found or had incorrect type.
468  template<class Type>
469  const Type* findObject
470  (
471  const word& name,
472  const bool recursive = false
473  ) const;
474 
475  //- Return non-const pointer to the object of the given Type.
476  //
477  // \param recursive search parent registries
478  //
479  // \return nullptr if the object was not found or had incorrect type.
480  template<class Type>
481  Type* findObject
482  (
483  const word& name,
484  const bool recursive = false
485  );
486 
487  //- Return non-const pointer to the object of the given Type,
488  //- using a const-cast to have it behave like a mutable.
489  // Exercise caution when using.
490  //
491  // \param recursive search parent registries.
492  //
493  // \return nullptr if the object was not found or had incorrect type.
494  template<class Type>
495  Type* getObjectPtr
496  (
497  const word& name,
498  const bool recursive = false
499  ) const;
500 
501  //- Lookup and return const reference to the object
502  //- of the given Type. Fatal if not found or the wrong type.
503  //
504  // \param recursive search parent registries.
505  template<class Type>
506  const Type& lookupObject
507  (
508  const word& name,
509  const bool recursive = false
510  ) const;
511 
512  //- Lookup and return non-const reference to the object
513  //- of the given Type. Fatal if not found or the wrong type.
514  //
515  // \param recursive search parent registries.
516  template<class Type>
517  Type& lookupObjectRef
518  (
519  const word& name,
520  const bool recursive = false
521  ) const;
522 
523 
524  // Events
525 
526  //- Return new event number.
527  label getEvent() const;
528 
529 
530  // Edit
531 
532  //- Add a regIOobject to registry. A nullptr is ignored.
533  bool checkIn(regIOobject* io) const;
534 
535  //- Add a regIOobject to registry
536  bool checkIn(regIOobject& io) const;
537 
538  //- Remove a regIOobject from registry and free memory if the
539  //- object is ownedByRegistry. A nullptr is ignored.
540  bool checkOut(regIOobject* io) const;
541 
542  //- Remove a regIOobject from registry and free memory if the
543  //- object is ownedByRegistry.
544  bool checkOut(regIOobject& io) const;
545 
546  //- Remove a regIOobject by name from registry and free memory if the
547  //- object is ownedByRegistry
548  bool checkOut(const word& key) const;
549 
550  //- Clear all entries from the registry
551  // Performs a checkOut() for all objects that are ownedByRegistry
552  void clear();
553 
554  //- Clear all entries from the registry and the table itself.
555  void clearStorage();
556 
557  //- Erase an entry specified by the given iterator.
558  // Performs a checkOut() if the object was ownedByRegistry.
559  // \return True if the entry existed and was removed
560  bool erase(const iterator& iter);
561 
562  //- Erase an entry specified by the given key
563  // Performs a checkOut() if the object was ownedByRegistry.
564  // \return True if the entry existed and was removed
565  bool erase(const word& key);
566 
567  //- Remove entries given by the listed keys
568  // Performs a checkOut() for all objects that are ownedByRegistry.
569  // \return The number of items removed
570  label erase(std::initializer_list<word> keys);
571 
572  //- Remove entries given by the listed keys
573  // Performs a checkOut() for all objects that are ownedByRegistry.
574  // \return The number of items removed
575  label erase(const UList<word>& keys);
576 
577  //- Rename
578  virtual void rename(const word& newName);
579 
580 
581  // Temporaries
582 
583  //FUTURE //- Add given name to the set of temporary objects to cache
584  //FUTURE void addTemporaryObject(const word& name) const;
585 
586  //- True if given name is in the cacheTemporaryObjects set
587  bool cacheTemporaryObject(const word& name) const;
588 
589  //- Cache the given object. Moves content and stores
590  template<class Type>
591  bool cacheTemporaryObject(Type& obj) const;
592 
593  //- Reset the cache state of the given object (nullptr is ignored)
594  void resetCacheTemporaryObject(const regIOobject* io) const;
595 
596  //- Reset the cache state of the given object
597  // in the cacheTemporaryObjects set
598  void resetCacheTemporaryObject(const regIOobject& io) const;
599 
600  //- Check that all objects specified in the cacheTemporaryObjects
601  //- were also cached
602  bool checkCacheTemporaryObjects() const;
603 
604 
605  // Reading
606 
607  //- Return true if any of the object's files have been modified
608  virtual bool modified() const;
609 
610  //- Read the objects that have been modified
611  void readModifiedObjects();
612 
613  //- Read object if modified
614  virtual bool readIfModified();
615 
616 
617  // Writing
618 
619  //- The writeData function is required by regIOobject but not used.
620  // For this class, write is used instead
621  virtual bool writeData(Ostream&) const
622  {
624  return false;
625  }
626 
627  //- Write the objects using stream options
628  virtual bool writeObject
629  (
630  IOstreamOption streamOpt,
631  const bool writeOnProc
632  ) const;
633 
634 
635  // Housekeeping
636 
637  //- Same as contains()
638  bool found(const word& name, bool recursive = false) const
639  {
640  return this->contains(name, recursive);
641  }
642 
643  //- Deprecated(2018-10) find object
644  // \deprecated(2018-10) - use findObject() method
645  template<class Type>
646  FOAM_DEPRECATED_FOR(2018-10, "findObject / cfindObject() methods")
647  const Type* lookupObjectPtr
648  (
649  const word& name,
650  bool recursive = false
651  ) const
652  {
653  return this->cfindObject<Type>(name, recursive);
654  }
655 
656  //- Deprecated(2018-10) get object pointer, ignoring constness
657  // \deprecated(2018-10) - use getObjectPtr() method
658  template<class Type>
659  FOAM_DEPRECATED_FOR(2018-10, "getObjectPtr() method")
660  Type* lookupObjectRefPtr
661  (
662  const word& name,
663  bool recursive = false
664  ) const
665  {
666  return this->getObjectPtr<Type>(name, recursive);
667  }
668 };
669 
670 
671 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
672 
673 } // End namespace Foam
674 
675 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
676 
677 #ifdef NoRepository
678  #include "objectRegistryTemplates.C"
679 #endif
680 
681 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
682 
683 #endif
684 
685 // ************************************************************************* //
bool contains(const word &name, const bool recursive=false) const
Does the registry contain the regIOobject object (by name).
UPtrList< const regIOobject > csorted() const
Return sorted list of objects.
bool cacheTemporaryObject(const word &name) const
True if given name is in the cacheTemporaryObjects set.
const Type & lookupObject(const word &name, const bool recursive=false) const
Lookup and return const reference to the object of the given Type. Fatal if not found or the wrong ty...
A class for handling file names.
Definition: fileName.H:71
void readModifiedObjects()
Read the objects that have been modified.
Type & lookupObjectRef(const word &name, const bool recursive=false) const
Lookup and return non-const reference to the object of the given Type. Fatal if not found or the wron...
const word & name() const noexcept
Return the object name.
Definition: IOobjectI.H:162
bool erase(const iterator &iter)
Erase an entry specified by the given iterator.
wordList names() const
The unsorted names of all objects.
virtual bool modified() const
Return true if any of the object&#39;s files have been modified.
const Type * findObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
A simple container for options an IOstream can normally have.
Operations on lists of strings.
const Type * cfindObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
const objectRegistry & subRegistry(const word &name, const bool forceCreate=false, const bool recursive=false) const
Lookup and return a const sub-objectRegistry.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:69
class FOAM_DEPRECATED_FOR(2017-05, "Foam::Enum") NamedEnum
Definition: NamedEnum.H:65
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc) const
Write the objects using stream options.
label count(const char *clsName) const
The number of objects of the given class name.
A class for handling words, derived from Foam::string.
Definition: word.H:63
Type * getObjectPtr(const word &name, const bool recursive=false) const
Return non-const pointer to the object of the given Type, using a const-cast to have it behave like a...
virtual bool writeData(Ostream &) const
The writeData function is required by regIOobject but not used.
const Time & time() const noexcept
Return time registry.
wordList sortedNames() const
The sorted names of all objects.
virtual ~objectRegistry()
Destructor, with checkOut() for all objects that are ownedByRegistry.
label getEvent() const
Return new event number.
const objectRegistry & db() const noexcept
Return the local objectRegistry.
Definition: IOobject.C:425
virtual bool readIfModified()
Read object if modified.
A HashTable similar to std::unordered_map.
Definition: HashTable.H:102
bool checkCacheTemporaryObjects() const
Check that all objects specified in the cacheTemporaryObjects were also cached.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:99
Type * lookupObjectRefPtr(const word &name, bool recursive=false) const
Deprecated(2018-10) get object pointer, ignoring constness.
bool isTimeDb() const noexcept
True if the registry is Time.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:55
void resetCacheTemporaryObject(const regIOobject *io) const
Reset the cache state of the given object (nullptr is ignored)
const direction noexcept
Definition: Scalar.H:258
bool checkOut()
Remove all file watches and remove object from registry.
Definition: regIOobject.C:223
TypeName("objectRegistry")
Declare type name for this IOobject.
void clearStorage()
Clear all entries from the registry and the table itself.
const Type * lookupObjectPtr(const word &name, bool recursive=false) const
Deprecated(2018-10) find object.
const objectRegistry & parent() const noexcept
Return the parent objectRegistry.
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
Definition: foamGltfBase.H:103
void clear()
Clear all entries from the registry.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:65
bool found(const word &name, bool recursive=false) const
Same as contains()
virtual const fileName & dbDir() const
Local directory path of this objectRegistry relative to the time.
bool foundObject(const word &name, const bool recursive=false) const
Is the named Type found?
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
Registry of regIOobjects.
UPtrList< const regIOobject > sorted() const
Return sorted list of objects.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:666
Defines the attributes of an object for which implicit objectRegistry management is supported...
Definition: IOobject.H:171
const objectRegistry & thisDb() const noexcept
Return the object registry.
HashTable< const Type * > lookupClass(const bool strict=false) const
Return all objects with a class satisfying isA<Type>
const_iterator_pair< const_key_iterator, this_type > keys() const
A const iterator begin/end pair for iterating over keys.
Definition: HashTable.H:1258
bool checkIn()
Add object to registry, if not already registered.
Definition: regIOobject.C:187
const regIOobject * cfindIOobject(const word &name, const bool recursive=false) const
Return const pointer to the regIOobject.
virtual void rename(const word &newName)
Rename.
Namespace for OpenFOAM.
HashTable< wordHashSet > classes() const
A summary hash of classes used and their associated object names.