42 #ifndef Foam_IOobjectList_H 43 #define Foam_IOobjectList_H 71 static void checkNameOrder(
const wordList& objectNames,
bool syncPar);
78 static void checkObjectOrder
85 static void syncNames(
wordList& objNames);
88 template<
class MatchPredicate>
92 const MatchPredicate& matchName
97 template<
class MatchPredicate1,
class MatchPredicate2>
98 static label countImpl
101 const MatchPredicate1& matchClass,
102 const MatchPredicate2& matchName
106 template<
class Type,
class MatchPredicate>
107 static label countTypeImpl
110 const MatchPredicate& matchName
114 template<
class MatchPredicate1,
class MatchPredicate2>
118 const MatchPredicate1& matchClass,
119 const MatchPredicate2& matchName,
124 template<
class Type,
class MatchPredicate>
128 const MatchPredicate& matchName,
133 template<
class Type,
class MatchPredicate>
137 const MatchPredicate& matchName,
142 template<
class MatchPredicate>
146 const MatchPredicate& matchName
150 template<
class MatchPredicate1,
class MatchPredicate2>
154 const MatchPredicate1& matchClass,
155 const MatchPredicate2& matchName
159 template<
class Type,
class MatchPredicate>
163 const MatchPredicate& matchName
178 inline explicit IOobjectList(
const label initialCapacity);
247 return remove(
io.name());
313 template<
class MatchPredicate>
320 template<
class MatchPredicate>
325 template<
class MatchPredicate1,
class MatchPredicate2>
328 const MatchPredicate1& matchClass,
329 const MatchPredicate2& matchName
341 template<
class Type,
class MatchPredicate>
421 template<
class MatchPredicate>
440 template<
class Type,
class MatchPredicate>
443 const MatchPredicate& matchName
469 return csorted<void>();
479 return csorted<void>(syncPar);
485 template<
class Type,
class MatchPredicate>
486 UPtrList<const IOobject>
csorted(
const MatchPredicate& matchName)
const;
493 template<
class Type,
class MatchPredicate>
494 UPtrList<const IOobject>
csorted 496 const MatchPredicate& matchName,
505 label
count(
const char* clsName)
const;
508 template<
class MatchPredicate>
511 const MatchPredicate& matchClass
516 template<
class MatchPredicate1,
class MatchPredicate2>
519 const MatchPredicate1& matchClass,
520 const MatchPredicate2& matchName
532 template<
class Type,
class MatchPredicate>
533 label
count(
const MatchPredicate& matchName)
const;
557 wordList names(
const char* clsName,
const bool syncPar)
const;
560 template<
class MatchPredicate>
568 template<
class MatchPredicate>
571 const MatchPredicate& matchClass,
577 template<
class MatchPredicate1,
class MatchPredicate2>
580 const MatchPredicate1& matchClass,
581 const MatchPredicate2& matchName
590 template<
class MatchPredicate1,
class MatchPredicate2>
593 const MatchPredicate1& matchClass,
594 const MatchPredicate2& matchName,
615 template<
class Type,
class MatchPredicate>
624 template<
class Type,
class MatchPredicate>
627 const MatchPredicate& matchName,
652 template<
class MatchPredicate>
658 template<
class MatchPredicate>
661 const MatchPredicate& matchClass,
667 template<
class MatchPredicate1,
class MatchPredicate2>
670 const MatchPredicate1& matchClass,
671 const MatchPredicate2& matchName
678 template<
class MatchPredicate1,
class MatchPredicate2>
681 const MatchPredicate1& matchClass,
682 const MatchPredicate2& matchName,
699 template<
class Type,
class MatchPredicate>
706 template<
class Type,
class MatchPredicate>
709 const MatchPredicate& matchName,
718 template<
class UnaryPredicate>
721 const UnaryPredicate& pred,
722 const bool pruning =
false 727 template<
class UnaryPredicate>
730 const UnaryPredicate& pred,
731 const bool pruning =
false 751 void checkNames(
const bool syncPar =
true)
const;
774 bool registerObject =
true 797 IOobject*
lookup(
const word& objName)
const 807 UPtrList<const IOobject>
sorted()
const 809 return csorted<Type>();
816 UPtrList<const IOobject>
sorted(const
bool syncPar)
const 818 return csorted<Type>(syncPar);
824 UPtrList<const IOobject>
sorted()
const 826 return csorted<void>();
832 UPtrList<const IOobject>
sorted(const
bool syncPar)
const 834 return csorted<void>(syncPar);
839 template<
class Type,
class MatchPredicate>
841 UPtrList<const IOobject>
sorted(const MatchPredicate& matchName)
const 843 return csorted<Type>(matchName);
848 template<
class Type,
class MatchPredicate>
850 UPtrList<const IOobject>
sorted 852 const MatchPredicate& matchName,
856 return csorted<Type>(matchName, syncPar);
862 Ostream&
operator<<(Ostream&
os,
const IOobjectList& list);
label filterClasses(const UnaryPredicate &pred, const bool pruning=false)
Filter to retain or prune given classes.
writeOption
Enumeration defining write preferences.
label prune_0()
Remove objects with names ending with "_0" (restart fields)
A class for handling file names.
List of IOobjects with searching and retrieving facilities. Implemented as a HashTable, so the various sorted methods should be used if traversing in parallel.
IOobjectList lookupClass() const
The list of IOobjects with headerClassName == Type::typeName.
bool add(autoPtr< IOobject > &objectPtr)
Move insert IOobject into the list.
wordList sortedNames() const
The sorted names of the IOobjects.
wordList names() const
The unsorted names of the IOobjects.
IOobjectList lookup(const MatchPredicate &matchName) const
The list of IOobjects that have a matching object name.
Ignore writing from objectRegistry::writeObject()
A HashTable of pointers to objects of type <T>, with deallocation management of the pointers...
class FOAM_DEPRECATED_FOR(2017-05, "Foam::Enum") NamedEnum
A class for handling words, derived from Foam::string.
const IOobject * findObject(const word &objName) const
Return const pointer to the object found by name.
wordList allNames() const
The sorted names of all objects (synchronised across processors)
A HashTable similar to std::unordered_map.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
UPtrList< const IOobject > cobjects() const
The unsorted list of IOobjects with headerClassName == Type::typeName.
UPtrList< const IOobject > sorted() const
Deprecated(2023-07) use csorted() method.
OBJstream os(runTime.globalPath()/outputName)
~IOobjectList()=default
Destructor.
IOobject * getObject(const word &objName) const
Return non-const pointer to the object found by name, using a const-cast to have it behave like a mut...
registerOption
Enumeration for use with registerObject(). Values map to bool (false/true)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
List< word > wordList
List of word.
void checkNames(const bool syncPar=true) const
Verify that object names are synchronised across processors.
label count() const
The number of objects with headerClassName == Type::typeName.
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
void operator=(const IOobjectList &)=delete
No copy assignment.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
label filterObjects(const UnaryPredicate &pred, const bool pruning=false)
Filter to retain or prune given object names.
IOobjectList() noexcept=default
Default construct: empty without allocation (capacity=0).
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
Registry of regIOobjects.
Defines the attributes of an object for which implicit objectRegistry management is supported...
UPtrList< const IOobject > csorted() const
The sorted list of IOobjects with headerClassName == Type::typeName.
Request registration (bool: true)
HashTable< wordHashSet > classes() const
A summary hash of classes used and their associated object names.
const IOobject * cfindObject(const word &objName) const
Return const pointer to the object found by name.
readOption
Enumeration defining read preferences.