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);
232 inline bool add(std::unique_ptr<IOobject>&& objectPtr);
250 return remove(
io.name());
316 template<
class MatchPredicate>
323 template<
class MatchPredicate>
328 template<
class MatchPredicate1,
class MatchPredicate2>
331 const MatchPredicate1& matchClass,
332 const MatchPredicate2& matchName
344 template<
class Type,
class MatchPredicate>
424 template<
class MatchPredicate>
443 template<
class Type,
class MatchPredicate>
446 const MatchPredicate& matchName
472 return csorted<void>();
482 return csorted<void>(syncPar);
488 template<
class Type,
class MatchPredicate>
489 UPtrList<const IOobject>
csorted(
const MatchPredicate& matchName)
const;
496 template<
class Type,
class MatchPredicate>
497 UPtrList<const IOobject>
csorted 499 const MatchPredicate& matchName,
508 label
count(
const char* clsName)
const;
511 template<
class MatchPredicate>
514 const MatchPredicate& matchClass
519 template<
class MatchPredicate1,
class MatchPredicate2>
522 const MatchPredicate1& matchClass,
523 const MatchPredicate2& matchName
535 template<
class Type,
class MatchPredicate>
536 label
count(
const MatchPredicate& matchName)
const;
560 wordList names(
const char* clsName,
const bool syncPar)
const;
563 template<
class MatchPredicate>
571 template<
class MatchPredicate>
574 const MatchPredicate& matchClass,
580 template<
class MatchPredicate1,
class MatchPredicate2>
583 const MatchPredicate1& matchClass,
584 const MatchPredicate2& matchName
593 template<
class MatchPredicate1,
class MatchPredicate2>
596 const MatchPredicate1& matchClass,
597 const MatchPredicate2& matchName,
618 template<
class Type,
class MatchPredicate>
627 template<
class Type,
class MatchPredicate>
630 const MatchPredicate& matchName,
655 template<
class MatchPredicate>
661 template<
class MatchPredicate>
664 const MatchPredicate& matchClass,
670 template<
class MatchPredicate1,
class MatchPredicate2>
673 const MatchPredicate1& matchClass,
674 const MatchPredicate2& matchName
681 template<
class MatchPredicate1,
class MatchPredicate2>
684 const MatchPredicate1& matchClass,
685 const MatchPredicate2& matchName,
702 template<
class Type,
class MatchPredicate>
709 template<
class Type,
class MatchPredicate>
712 const MatchPredicate& matchName,
721 template<
class UnaryPredicate>
724 const UnaryPredicate& pred,
725 const bool pruning =
false 730 template<
class UnaryPredicate>
733 const UnaryPredicate& pred,
734 const bool pruning =
false 754 void checkNames(
const bool syncPar =
true)
const;
777 bool registerObject =
true 800 IOobject*
lookup(
const word& objName)
const 810 UPtrList<const IOobject>
sorted()
const 812 return csorted<Type>();
819 UPtrList<const IOobject>
sorted(const
bool syncPar)
const 821 return csorted<Type>(syncPar);
827 UPtrList<const IOobject>
sorted()
const 829 return csorted<void>();
835 UPtrList<const IOobject>
sorted(const
bool syncPar)
const 837 return csorted<void>(syncPar);
842 template<
class Type,
class MatchPredicate>
844 UPtrList<const IOobject>
sorted(const MatchPredicate& matchName)
const 846 return csorted<Type>(matchName);
851 template<
class Type,
class MatchPredicate>
853 UPtrList<const IOobject>
sorted 855 const MatchPredicate& matchName,
859 return csorted<Type>(matchName, syncPar);
865 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.
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.
bool add(std::unique_ptr< IOobject > &&objectPtr)
Move insert IOobject into the list.
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.