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);
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
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
810 UPtrList<const IOobject>
sorted()
const
819 UPtrList<const IOobject>
sorted(const
bool syncPar)
const
827 UPtrList<const IOobject>
sorted()
const
842 template<
class Type,
class MatchPredicate>
851 template<
class Type,
class MatchPredicate>
855 const MatchPredicate& matchName,
constexpr HashPtrTable() noexcept=default
A HashTable similar to std::unordered_map.
List of IOobjects with searching and retrieving facilities. Implemented as a HashTable,...
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.
UPtrList< const IOobject > csorted(const bool syncPar) const
The sorted list of IOobjects with optional check for parallel consistency.
IOobject * lookup(const word &objName) const
Deprecated(2018-11) Locate an object by name (const word&). Disambiguated from multiple-lookup versio...
wordList sortedNames(const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName) const
The sorted names of IOobjects with the given headerClassName that also have a matching object name.
IOobject * findObject(const word &objName)
Return non-const pointer to the object found by name that also has headerClassName == Type::typeName.
label count(const MatchPredicate &matchName) const
The number of objects with headerClassName == Type::typeName that also have a matching object name.
const IOobject * findObject(const word &objName) const
Return const pointer to the object found by name.
const IOobject * cfindObject(const word &objName) const
Return const pointer to the object found by name that also has headerClassName == Type::typeName.
UPtrList< const IOobject > csorted() const
The sorted list of IOobjects.
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.
IOobjectList lookupClass(const MatchPredicate &matchName) const
The list of IOobjects with headerClassName == Type::typeName that also have a matching object name.
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
The sorted names of the IOobjects with the given headerClassName that also have a matching object nam...
wordList sortedNames(const MatchPredicate &matchName, const bool syncPar) const
The sorted names of objects with headerClassName == Type::typeName that also have a matching object n...
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
Return const pointer to the object found by name that also has headerClassName == Type::typeName.
const IOobject * cfindObject(const word &objName) const
Return const pointer to the object found by name.
UPtrList< const IOobject > csorted(const MatchPredicate &matchName, const bool syncPar) const
The sorted list of IOobjects with headerClassName == Type::typeName that also have a matching object ...
wordList names(const MatchPredicate &matchClass) const
The unsorted names of IOobjects with the given headerClassName.
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...
wordList names(bool syncPar) const
The sorted names of objects with headerClassName == Type::typeName.
HashTable< wordHashSet > classes() const
A summary hash of classes used and their associated object names.
UPtrList< const IOobject > cobjects() const
The unsorted list of IOobjects with headerClassName == Type::typeName.
IOobjectList lookupClass(const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName) const
The list of IOobjects with matching headerClassName that also have a matching object name.
void checkNames(const bool syncPar=true) const
Verify that object names are synchronised across processors.
IOobjectList() noexcept=default
Default construct: empty without allocation (capacity=0).
UPtrList< const IOobject > csorted(const bool syncPar) const
The sorted names of the IOobjects with optional check for parallel consistency.
IOobject * getObject(const word &objName) const
Return non-const pointer to the object found by name that also has headerClassName == Type::typeName,...
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).
wordList names(const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName) const
The unsorted names of IOobjects with the given headerClassName that also have a matching object name.
label filterObjects(const UnaryPredicate &pred, const bool pruning=false)
Filter to retain or prune given object names.
wordList names(const MatchPredicate &matchName) const
The unsorted names of objects with headerClassName == Type::typeName and a matching object name.
wordList names() const
The unsorted names of objects with headerClassName == Type::typeName.
UPtrList< const IOobject > csorted() const
The sorted list of IOobjects with headerClassName == Type::typeName.
HashTable< wordHashSet > classes(const MatchPredicate &matchName) const
A summary hash of classes used and their associated object names, restricted to objects that have a m...
wordList allNames() const
The sorted names of all objects (synchronised across processors).
label count() const
The number of objects with headerClassName == Type::typeName.
wordList sortedNames(const MatchPredicate &matchName) const
The sorted names of objects with headerClassName == Type::typeName that also have a matching object n...
wordList sortedNames() const
The sorted names of objects with headerClassName == Type::typeName.
bool add(std::unique_ptr< IOobject > &&objectPtr)
Move insert IOobject into the list.
UPtrList< const IOobject > csorted(const MatchPredicate &matchName) const
The sorted list of IOobjects with headerClassName == Type::typeName that also have a matching object ...
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
Deprecated(2023-07) use csorted() method.
wordList names() const
The unsorted names of the IOobjects.
label count(const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName) const
The number of objects of the given headerClassName that also have a matching object name.
UPtrList< const IOobject > cobjects(const MatchPredicate &matchName) const
The unsorted list of IOobjects with headerClassName == Type::typeName that also have a matching objec...
~IOobjectList()=default
Destructor.
wordList sortedNames(const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName, const bool syncPar) const
The sorted names of the IOobjects with the given headerClassName that also have a matching object nam...
IOobjectList(const objectRegistry &db, const fileName &instance, const fileName &local, IOobjectOption::readOption rOpt, IOobjectOption::writeOption wOpt=IOobjectOption::NO_WRITE, bool registerObject=true)
Construct from registry, instance, local, io options.
wordList allNames() const
The sorted names of all objects (synchronised across processors) with headerClassName == Type::typeNa...
IOobject * lookup(const char *objName) const
Deprecated(2018-11) Locate an object by name (c-string). Disambiguated from multiple-lookup version b...
autoPtr< IOobject > remove(const IOobject &io)
Remove object from the list by its IOobject::name().
wordList names(const MatchPredicate &matchName, const bool syncPar) const
The sorted names of objects with headerClassName == Type::typeName and a matching object name.
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
registerOption
Enumeration for use with registerObject(). Values map to bool (false/true).
@ REGISTER
Request registration (bool: true).
readOption
Enumeration defining read preferences.
writeOption
Enumeration defining write preferences.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A class for handling file names.
Registry of regIOobjects.
A class for handling words, derived from Foam::string.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
OBJstream os(runTime.globalPath()/outputName)
List< word > wordList
List of word.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
#define FOAM_DEPRECATED_FOR(since, replacement)