IOobjectList.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-2016 OpenFOAM Foundation
9 Copyright (C) 2016-2022 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::IOobjectList
29
30Description
31 List of IOobjects with searching and retrieving facilities.
32
33SourceFiles
34 IOobjectList.C
35 IOobjectListTemplates.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef Foam_IOobjectList_H
40#define Foam_IOobjectList_H
41
42#include "HashPtrTable.H"
43#include "HashSet.H"
44#include "UPtrList.H"
45#include "IOobject.H"
46#include "wordRes.H"
47
48// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49
50namespace Foam
51{
52
53/*---------------------------------------------------------------------------*\
54 Class IOobjectList Declaration
55\*---------------------------------------------------------------------------*/
57class IOobjectList
58:
59 public HashPtrTable<IOobject>
60{
61 // Private Member Functions
62
63 //- Check consistency of names and their order on all processors
64 //- (the input list is assumed to be pre-sorted).
65 //
66 // With syncPar = true, check that object names are identical
67 // (content and order) on all processors. FatalError if not.
68 static void checkNameOrder(const wordList& objectNames, bool syncPar);
69
70 //- Check consistency of object names/order on all processors
71 //- (the input list is assumed to be pre-sorted).
72 //
73 // With syncPar = true, check that object names are identical
74 // (content and order) on all processors. FatalError if not.
75 static void checkObjectOrder
76 (
77 const UPtrList<const IOobject>& objs,
78 bool syncPar
79 );
80
81 //- Combine names from all processors and sort
82 static void syncNames(wordList& objNames);
83
84 //- Templated implementation for classes()
85 template<class MatchPredicate>
86 static HashTable<wordHashSet> classesImpl
87 (
88 const IOobjectList& list,
89 const MatchPredicate& matchName
90 );
91
92 //- Templated implementation for count()
93 // The number of items with a matching class
94 template<class MatchPredicate1, class MatchPredicate2>
95 static label countImpl
96 (
97 const IOobjectList& list,
98 const MatchPredicate1& matchClass,
99 const MatchPredicate2& matchName
100 );
101
102 //- Templated implementation for count()
103 template<class Type, class MatchPredicate>
104 static label countTypeImpl
105 (
106 const IOobjectList& list,
107 const MatchPredicate& matchName
108 );
109
110 //- Templated implementation for names(), sortedNames()
111 template<class MatchPredicate1, class MatchPredicate2>
112 static wordList namesImpl
113 (
114 const IOobjectList& list,
115 const MatchPredicate1& matchClass,
116 const MatchPredicate2& matchName,
117 const bool doSort
118 );
119
120 //- Templated implementation for names(), sortedNames()
121 template<class Type, class MatchPredicate>
122 static wordList namesTypeImpl
123 (
124 const IOobjectList& list,
125 const MatchPredicate& matchName,
126 const bool doSort
127 );
128
129 //- Templated implementation for sorted()
130 template<class Type, class MatchPredicate>
131 static UPtrList<const IOobject> objectsTypeImpl
132 (
133 const IOobjectList& list,
134 const MatchPredicate& matchName
135 );
136
137 //- Templated implementation for lookup()
138 template<class MatchPredicate>
139 static IOobjectList lookupImpl
140 (
141 const IOobjectList& list,
142 const MatchPredicate& matchName
143 );
144
145 //- Templated implementation for lookupClass()
146 template<class MatchPredicate1, class MatchPredicate2>
147 static IOobjectList lookupClassImpl
148 (
149 const IOobjectList& list,
150 const MatchPredicate1& matchClass,
151 const MatchPredicate2& matchName
152 );
153
154 //- Templated implementation for lookupClass()
155 template<class Type, class MatchPredicate>
156 static IOobjectList lookupClassTypeImpl
157 (
158 const IOobjectList& list,
159 const MatchPredicate& matchName
160 );
161
162
163public:
164
165 // Constructors
166
167 //- Construct null with default (128) table capacity
168 IOobjectList();
169
170 //- Construct given initial table capacity
171 explicit IOobjectList(const label nObjects);
172
173 //- Copy construct
174 IOobjectList(const IOobjectList& list);
175
176 //- Move construct
178
179 //- Construct from objectRegistry and instance path
181 (
182 const objectRegistry& db,
183 const fileName& instance,
184 const fileName& local = "",
187 bool registerObject = true
188 );
189
190
191 //- Destructor
192 ~IOobjectList() = default;
193
194
195 // Member Functions
196
197 // Basic methods
198
199 //- Add IOobject to the list
200 bool add(autoPtr<IOobject>& objectPtr);
201
202 //- Add IOobject to the list
203 bool add(autoPtr<IOobject>&& objectPtr);
204
205 //- Copy append objects from other to this list, but do not overwrite
206 //- existing keys.
207 //
208 // \return number of items added
209 label append(const IOobjectList& other);
210
211 //- Move append objects from other to this list, but do not overwrite
212 //- existing keys.
213 // After calling this, the other parameter will contains any items
214 // that could not be moved.
215 //
216 // \return number of items added
217 label append(IOobjectList&& other);
218
219 //- Remove IOobject from the list, by name or by iterator.
220 //
221 // \return autoPtr<IOobject>
223
224 //- Remove IOobject from the list.
225 //
226 // \return True if object was removed
227 bool remove(const IOobject& io);
228
229
230 // Lookup single item
231
232 //- Return const pointer to the object found by name
233 // \return IOobject ptr if found else nullptr
234 const IOobject* cfindObject(const word& objName) const;
235
236 //- Return const pointer to the object found by name that also
237 //- has headerClassName == Type::typeName
238 // \return IOobject ptr if found and the correct type, else nullptr
239 //
240 // \note If \a Type is \c void, no headerClassName check is used
241 // (always true).
242 template<class Type>
243 const IOobject* cfindObject(const word& objName) const;
244
245 //- Return const pointer to the object found by name
246 // \return IOobject ptr if found else nullptr
247 const IOobject* findObject(const word& objName) const;
248
249 //- Return const pointer to the object found by name that also
250 //- has headerClassName == Type::typeName
251 // \return IOobject ptr if found and the correct type, else nullptr
252 //
253 // \note If \a Type is \c void, no headerClassName check is used
254 // (always true).
255 template<class Type>
256 const IOobject* findObject(const word& objName) const;
257
258 //- Return non-const pointer to the object found by name
259 // \return IOobject ptr if found else nullptr
260 IOobject* findObject(const word& objName);
261
262 //- Return non-const pointer to the object found by name that also
263 //- has headerClassName == Type::typeName
264 // \return IOobject ptr if found and the correct type, else nullptr
265 //
266 // \note If \a Type is \c void, no headerClassName check is used
267 // (always true).
268 template<class Type>
269 IOobject* findObject(const word& objName);
270
271 //- Return non-const pointer to the object found by name,
272 //- using a const-cast to have it behave like a mutable.
273 // Exercise caution when using.
274 // \return IOobject ptr if found else nullptr
275 IOobject* getObject(const word& objName) const;
276
277 //- Return non-const pointer to the object found by name that also
278 //- has headerClassName == Type::typeName,
279 //- using a const-cast to have it behave like a mutable.
280 // Exercise caution when using.
281 // \return IOobject ptr if found and the correct type, else nullptr
282 //
283 // \note If \a Type is \c void, no headerClassName check is used
284 // (always true).
285 template<class Type>
286 IOobject* getObject(const word& objName) const;
287
288
289 // Lookup multiple items
290
291 //- The list of IOobjects that have a matching object name.
292 template<class MatchPredicate>
293 IOobjectList lookup(const MatchPredicate& matchName) const;
294
295 //- The list of IOobjects with the given headerClassName
296 IOobjectList lookupClass(const char* clsName) const;
297
298 //- The list of IOobjects with matching headerClassName
299 template<class MatchPredicate>
300 IOobjectList lookupClass(const MatchPredicate& matchClass) const;
301
302 //- The list of IOobjects with matching headerClassName
303 //- that also have a matching object name.
304 template<class MatchPredicate1, class MatchPredicate2>
306 (
307 const MatchPredicate1& matchClass,
308 const MatchPredicate2& matchName
309 ) const;
310
311 //- The list of IOobjects with headerClassName == Type::typeName
312 //
313 // \note If \a Type is \c void, no headerClassName check is used
314 // (always true).
315 template<class Type>
317
318 //- The list of IOobjects with headerClassName == Type::typeName
319 //- that also have a matching object name.
320 template<class Type, class MatchPredicate>
321 IOobjectList lookupClass(const MatchPredicate& matchName) const;
322
323
324 // Summary of classes
325
326 //- A summary hash of classes used and their associated object names.
327 // The HashTable representation allows us to leverage various
328 // HashTable methods.
329 // This hashed summary view can be useful when querying particular
330 // aspects. For example,
331 //
332 // \code
333 // IOobjectList objects(runTime, runTime.timeName());
334 // HashTable<wordHashSet> classes = objects.classes();
335 //
336 // // How many volScalarField?
337 // word checkType = volScalarField::typeName;
338 //
339 // Info<< checkType << "="
340 // << (classes.found(checkType) ? classes[checkType].size() : 0)
341 // << nl;
342 // \endcode
343 // Using the two-parameter HashTable::lookup method lets us avoid
344 // the \c '?' ternary, but still looks fairly ugly:
345 // \code
346 // Info<< checkType << "="
347 // << classes.lookup(checkType, wordHashSet()).size() << nl;
348 // \endcode
349 //
350 // If we have non-const access to the hash table, and don't mind
351 // incidentally creating empty entries,
352 // we can use the HashTable::operator() directly:
353 // \code
354 // Info<< checkType << "=" << classes(checkType).size() << nl;
355 // \endcode
356 //
357 // Of course, for a single query it would have been easier
358 // and simpler to have used a direct query of the names:
359 // \code
360 // Info<< checkType << "=" << objects.names(checkType).size() << nl;
361 // \endcode
362 //
363 // The summary hash, however, becomes most useful when reducing
364 // the objects in consideration to a particular subset. For example,
365 // \code
366 // const wordHashSet interestingTypes
367 // {
368 // volScalarField::typeName,
369 // volVectorField::typeName
370 // };
371 //
372 // classes.retain(interestingTypes);
373 // \endcode
374 // Or do just the opposite:
375 // \code
376 // classes.erase(unsupportedTypes);
377 // \endcode
378 // This also works with a hashedWordList, since it provides the
379 // expected '()' operator. But in this case the more general
380 // HashTable::filterKeys is required:
381 // \code
382 // const hashedWordList interestingTypes
383 // {
384 // volScalarField::typeName,
385 // volVectorField::typeName
386 // };
387 //
388 // classes.filterKeys(interestingTypes);
389 // \endcode
390 //
391 // Of course, there are many other ways to use and manipulate the
392 // summary information.
393 //
394 // \return HashTable of class-names for keys and wordHashSet of
395 // of object-names for the values.
397
398 //- A summary hash of classes used and their associated object names,
399 //- restricted to objects that have a matching object name.
400 template<class MatchPredicate>
401 HashTable<wordHashSet> classes(const MatchPredicate& matchName) const;
402
403
404 // Sorted access
405
406 //- The sorted list of IOobjects
407 // The lifetime of the returned content cannot exceed the parent!
409
410 //- The sorted list of IOobjects with optional check for
411 //- parallel consistency.
412 // FatalError if syncPar = true and names are not consistent on all
413 // processors.
414 // The lifetime of the returned content cannot exceed the parent!
415 UPtrList<const IOobject> sorted(const bool syncPar) const;
416
417 //- The sorted list of IOobjects with headerClassName == Type::typeName
418 //
419 // \note If \a Type is \c void, no headerClassName check is used
420 // (always true).
421 // The lifetime of the returned content cannot exceed the parent!
422 template<class Type>
424
425 //- The sorted names of the IOobjects with optional check for
426 //- parallel consistency.
427 // FatalError if syncPar = true and names are not consistent on all
428 // processors.
429 // The lifetime of the returned content cannot exceed the parent!
430 template<class Type>
431 UPtrList<const IOobject> sorted(const bool syncPar) const;
432
433 //- The sorted list of IOobjects with headerClassName == Type::typeName
434 //- that also have a matching object name.
435 // The lifetime of the returned content cannot exceed the parent!
436 template<class Type, class MatchPredicate>
437 UPtrList<const IOobject> sorted(const MatchPredicate& matchName) const;
438
439 //- The sorted list of IOobjects with headerClassName == Type::typeName
440 //- that also have a matching object name.
441 // FatalError if syncPar = true and names are not consistent on all
442 // processors.
443 // The lifetime of the returned content cannot exceed the parent!
444 template<class Type, class MatchPredicate>
446 (
447 const MatchPredicate& matchName,
448 const bool syncPar
449 ) const;
450
451
452 // Number of items
453
454 //- The number of objects of the given headerClassName
455 // \note uses the class type() method
456 label count(const char* clsName) const;
457
458 //- The number of objects of the given headerClassName
459 template<class MatchPredicate>
460 label count
461 (
462 const MatchPredicate& matchClass
463 ) const;
464
465 //- The number of objects of the given headerClassName
466 //- that also have a matching object name.
467 template<class MatchPredicate1, class MatchPredicate2>
468 label count
469 (
470 const MatchPredicate1& matchClass,
471 const MatchPredicate2& matchName
472 ) const;
473
474 //- The number of objects with headerClassName == Type::typeName
475 template<class Type>
476 label count() const;
477
478 //- The number of objects with headerClassName == Type::typeName
479 //- that also have a matching object name.
480 //
481 // \note If \a Type is \c void, no headerClassName check is used
482 // (always true).
483 template<class Type, class MatchPredicate>
484 label count(const MatchPredicate& matchName) const;
485
486
487 // Summary of names
488
489 //- The unsorted names of the IOobjects
490 wordList names() const;
491
492 //- The sorted names of the IOobjects with optional check for
493 //- parallel consistency.
494 // FatalError if syncPar = true and names are not consistent on all
495 // processors.
496 // \note Output is always sorted - for consistent serial/parallel
497 // behaviour.
498 wordList names(const bool syncPar) const;
499
500 //- The unsorted names of IOobjects with the given headerClassName
501 wordList names(const char* clsName) const;
502
503 //- The sorted names of the IOobjects with the given headerClassName
504 // FatalError if syncPar = true and names are not consistent on all
505 // processors.
506 // \note Output is always sorted - for consistent serial/parallel
507 // behaviour.
508 wordList names(const char* clsName, const bool syncPar) const;
509
510 //- The unsorted names of IOobjects with the given headerClassName
511 template<class MatchPredicate>
512 wordList names(const MatchPredicate& matchClass) const;
513
514 //- The sorted names of the IOobjects with the given headerClassName
515 // FatalError if syncPar = true and names are not consistent on all
516 // processors.
517 // \note Output is always sorted - for consistent serial/parallel
518 // behaviour.
519 template<class MatchPredicate>
521 (
522 const MatchPredicate& matchClass,
523 const bool syncPar
524 ) const;
525
526 //- The unsorted names of IOobjects with the given headerClassName
527 //- that also have a matching object name.
528 template<class MatchPredicate1, class MatchPredicate2>
530 (
531 const MatchPredicate1& matchClass,
532 const MatchPredicate2& matchName
533 ) const;
534
535 //- The sorted names of the IOobjects with the given headerClassName
536 //- that also have a matching object name.
537 // FatalError if syncPar = true and names are not consistent on all
538 // processors.
539 // \note Output is always sorted - for consistent serial/parallel
540 // behaviour.
541 template<class MatchPredicate1, class MatchPredicate2>
543 (
544 const MatchPredicate1& matchClass,
545 const MatchPredicate2& matchName,
546 const bool syncPar
547 ) const;
548
549
550 //- The unsorted names of objects with
551 //- headerClassName == Type::typeName
552 template<class Type>
553 wordList names() const;
554
555 //- The sorted names of objects with
556 //- headerClassName == Type::typeName.
557 // FatalError if syncPar = true and names are not consistent on all
558 // processors.
559 // \note Output is always sorted - for consistent serial/parallel
560 // behaviour.
561 template<class Type>
562 wordList names(bool syncPar) const;
563
564 //- The unsorted names of objects with
565 //- headerClassName == Type::typeName and a matching object name.
566 template<class Type, class MatchPredicate>
567 wordList names(const MatchPredicate& matchName) const;
568
569 //- The sorted names of objects with
570 //- headerClassName == Type::typeName and a matching object name.
571 // FatalError if syncPar = true and names are not consistent on all
572 // processors.
573 // \note Output is always sorted - for consistent serial/parallel
574 // behaviour.
575 template<class Type, class MatchPredicate>
577 (
578 const MatchPredicate& matchName,
579 const bool syncPar
580 ) const;
581
582
583 // Summary of names (sorted)
584
585 //- The sorted names of the IOobjects
586 wordList sortedNames() const;
587
588 //- The sorted names of the IOobjects with optional check for
589 //- parallel consistency.
590 // FatalError if syncPar = true and names are not consistent on all
591 // processors.
592 wordList sortedNames(const bool syncPar) const;
593
594 //- The sorted names of IOobjects with the given headerClassName
595 wordList sortedNames(const char* clsName) const;
596
597 //- The sorted names of the IOobjects with the given headerClassName
598 // FatalError if syncPar = true and names are not consistent on all
599 // processors.
600 wordList sortedNames(const char* clsName, const bool syncPar) const;
601
602 //- The sorted names of IOobjects with the given headerClassName
603 template<class MatchPredicate>
604 wordList sortedNames(const MatchPredicate& matchClass) const;
605
606 //- The sorted names of the IOobjects with the given headerClassName
607 // FatalError if syncPar = true and names are not consistent on all
608 // processors.
609 template<class MatchPredicate>
611 (
612 const MatchPredicate& matchClass,
613 const bool syncPar
614 ) const;
615
616 //- The sorted names of IOobjects with the given headerClassName
617 //- that also have a matching object name.
618 template<class MatchPredicate1, class MatchPredicate2>
620 (
621 const MatchPredicate1& matchClass,
622 const MatchPredicate2& matchName
623 ) const;
624
625 //- The sorted names of the IOobjects with the given headerClassName
626 //- that also have a matching object name.
627 // FatalError if syncPar = true and names are not consistent on all
628 // processors.
629 template<class MatchPredicate1, class MatchPredicate2>
631 (
632 const MatchPredicate1& matchClass,
633 const MatchPredicate2& matchName,
634 const bool syncPar
635 ) const;
636
637
638 //- The sorted names of objects with headerClassName == Type::typeName
639 template<class Type>
640 wordList sortedNames() const;
641
642 //- The sorted names of objects with headerClassName == Type::typeName
643 // FatalError if syncPar = true and names are not consistent on all
644 // processors.
645 template<class Type>
646 wordList sortedNames(bool syncPar) const;
647
648 //- The sorted names of objects with headerClassName == Type::typeName
649 //- that also have a matching object name.
650 template<class Type, class MatchPredicate>
651 wordList sortedNames(const MatchPredicate& matchName) const;
652
653 //- The sorted names of objects with headerClassName == Type::typeName
654 //- that also have a matching object name.
655 // FatalError if syncPar = true and names are not consistent on all
656 // processors.
657 template<class Type, class MatchPredicate>
659 (
660 const MatchPredicate& matchName,
661 const bool syncPar
662 ) const;
663
664
665 // Edit
666
667 //- Filter to retain or prune given classes
668 // \return The number of items changed (removed)
669 template<class UnaryPredicate>
670 label filterClasses
671 (
672 const UnaryPredicate& pred,
673 const bool pruning = false
674 );
675
676 //- Filter to retain or prune given object names
677 // \return The number of items changed (removed)
678 template<class UnaryPredicate>
679 label filterObjects
680 (
681 const UnaryPredicate& pred,
682 const bool pruning = false
683 );
684
685 //- Remove objects with names ending with "_0" (restart fields)
686 // \return The number of items changed (removed)
687 label prune_0();
688
689
690 // Parallel
691
692 //- The sorted names of all objects (synchronised across processors)
693 wordList allNames() const;
694
695 //- The sorted names of all objects (synchronised across processors)
696 //- with headerClassName == Type::typeName
697 template<class Type>
698 wordList allNames() const;
699
700 //- Verify that object names are synchronised across processors
701 // FatalError if the names are not consistent on all processors.
702 void checkNames(const bool syncPar = true) const;
703
704
705 // Member Operators
706
707 //- No copy assignment
708 void operator=(const IOobjectList&) = delete;
709
710 //- Move assignment
711 void operator=(IOobjectList&& list);
712
713
714 // Housekeeping
715
716 //- Deprecated(2018-11) Locate an object by name (c-string).
717 //- Disambiguated from multiple-lookup version by calling parameter.
718 // \deprecated(2018-11) use findObject() for non-ambiguous resolution
719 IOobject* lookup(const char* objName) const
720 {
721 return getObject(objName);
722 }
723
724 //- Deprecated(2018-11) Locate an object by name (const word&).
725 //- Disambiguated from multiple-lookup version by calling parameter.
726 // \deprecated(2018-11) use findObject() for non-ambiguous resolution
727 IOobject* lookup(const word& objName) const
728 {
729 return getObject(objName);
730 }
731};
732
733
734// Ostream operator
735Ostream& operator<<(Ostream& os, const IOobjectList& list);
736
737
738// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
739
740} // End namespace Foam
741
742// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
743
744#ifdef NoRepository
745 #include "IOobjectListTemplates.C"
746#endif
747
748// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
749
750#endif
751
752// ************************************************************************* //
A HashTable of pointers to objects of type <T>, with deallocation management of the pointers.
Definition: HashPtrTable.H:68
A HashTable similar to std::unordered_map.
Definition: HashTable.H:123
List of IOobjects with searching and retrieving facilities.
Definition: IOobjectList.H:59
wordList sortedNames(bool syncPar) const
The sorted names of objects with headerClassName == Type::typeName.
label count(const MatchPredicate &matchClass) const
The number of objects of the given headerClassName.
wordList sortedNames(const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName) const
IOobject * findObject(const word &objName)
label count(const MatchPredicate &matchName) const
const IOobject * findObject(const word &objName) const
Return const pointer to the object found by name.
Definition: IOobjectList.C:293
const IOobject * cfindObject(const word &objName) const
UPtrList< const IOobject > sorted(const bool syncPar) const
label append(const IOobjectList &other)
Definition: IOobjectList.C:209
IOobjectList()
Construct null with default (128) table capacity.
Definition: IOobjectList.C:104
IOobjectList lookup(const MatchPredicate &matchName) const
The list of IOobjects that have a matching object name.
wordList sortedNames() const
The sorted names of the IOobjects.
Definition: IOobjectList.C:383
IOobjectList lookupClass(const MatchPredicate &matchName) const
IOobjectList lookupClass(const MatchPredicate &matchClass) const
The list of IOobjects with matching headerClassName.
wordList names(const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName, const bool syncPar) const
wordList sortedNames(const MatchPredicate &matchName, const bool syncPar) const
wordList names(const MatchPredicate &matchClass, const bool syncPar) const
The sorted names of the IOobjects with the given headerClassName.
label filterClasses(const UnaryPredicate &pred, const bool pruning=false)
Filter to retain or prune given classes.
void operator=(const IOobjectList &)=delete
No copy assignment.
const IOobject * findObject(const word &objName) const
const IOobject * cfindObject(const word &objName) const
Return const pointer to the object found by name.
Definition: IOobjectList.C:268
wordList names(const MatchPredicate &matchClass) const
The unsorted names of IOobjects with the given headerClassName.
IOobject * getObject(const word &objName) const
Definition: IOobjectList.C:307
wordList names(bool syncPar) const
HashTable< wordHashSet > classes() const
A summary hash of classes used and their associated object names.
Definition: IOobjectList.C:320
IOobjectList lookupClass(const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName) const
void checkNames(const bool syncPar=true) const
Verify that object names are synchronised across processors.
Definition: IOobjectList.C:438
UPtrList< const IOobject > sorted(const MatchPredicate &matchName) const
UPtrList< const IOobject > sorted(const MatchPredicate &matchName, const bool syncPar) const
IOobject * getObject(const word &objName) const
wordList sortedNames(const MatchPredicate &matchClass, const bool syncPar) const
The sorted names of the IOobjects with the given headerClassName.
label prune_0()
Remove objects with names ending with "_0" (restart fields)
Definition: IOobjectList.C:418
wordList names(const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName) const
label filterObjects(const UnaryPredicate &pred, const bool pruning=false)
Filter to retain or prune given object names.
wordList names(const MatchPredicate &matchName) const
wordList names() const
HashTable< wordHashSet > classes(const MatchPredicate &matchName) const
wordList allNames() const
The sorted names of all objects (synchronised across processors)
Definition: IOobjectList.C:429
label count() const
The number of objects with headerClassName == Type::typeName.
wordList sortedNames(const MatchPredicate &matchName) const
wordList sortedNames() const
The sorted names of objects with headerClassName == Type::typeName.
UPtrList< const IOobject > sorted() const
The sorted list of IOobjects.
Definition: IOobjectList.C:336
bool remove(const IOobject &io)
Remove IOobject from the list.
Definition: IOobjectList.C:259
wordList sortedNames(const MatchPredicate &matchClass) const
The sorted names of IOobjects with the given headerClassName.
IOobjectList lookupClass() const
The list of IOobjects with headerClassName == Type::typeName.
UPtrList< const IOobject > sorted() const
The sorted list of IOobjects with headerClassName == Type::typeName.
bool add(autoPtr< IOobject > &objectPtr)
Add IOobject to the list.
Definition: IOobjectList.C:187
wordList names() const
The unsorted names of the IOobjects.
Definition: IOobjectList.C:351
label count(const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName) const
~IOobjectList()=default
Destructor.
wordList sortedNames(const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName, const bool syncPar) const
wordList allNames() const
wordList names(const MatchPredicate &matchName, const bool syncPar) const
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
writeOption
Enumeration defining the write options.
Definition: IOobject.H:186
readOption
Enumeration defining the read options.
Definition: IOobject.H:177
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Definition: UPtrList.H:71
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A class for handling file names.
Definition: fileName.H:76
Registry of regIOobjects.
Lookup type of boundary radiation properties.
Definition: lookup.H:66
A class for handling words, derived from Foam::string.
Definition: word.H:68
OBJstream os(runTime.globalPath()/outputName)
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
Namespace for OpenFOAM.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83