34template<
class MatchPredicate>
38 const MatchPredicate& matchName
47 const word& key = iter.key();
53 summary(
io->headerClassName()).
insert(key);
62template<
class MatchPredicate1,
class MatchPredicate2>
63Foam::label Foam::IOobjectList::countImpl
66 const MatchPredicate1& matchClass,
67 const MatchPredicate2& matchName
76 if (matchClass(
io->headerClassName()) && matchName(
io->name()))
87template<
class Type,
class MatchPredicate>
88Foam::label Foam::IOobjectList::countTypeImpl
91 const MatchPredicate& matchName
100 if (
io->isHeaderClass<Type>() && matchName(
io->name()))
111template<
class MatchPredicate1,
class MatchPredicate2>
115 const MatchPredicate1& matchClass,
116 const MatchPredicate2& matchName,
125 const word& key = iter.key();
128 if (matchClass(
io->headerClassName()) && matchName(key))
130 objNames[count] = key;
147template<
class Type,
class MatchPredicate>
151 const MatchPredicate& matchName,
160 const word& key = iter.key();
163 if (
io->isHeaderClass<Type>() && matchName(key))
165 objNames[count] = key;
182template<
class Type,
class MatchPredicate>
184Foam::IOobjectList::objectsTypeImpl
187 const MatchPredicate& matchName,
196 const word& key = iter.key();
199 if (
io->isHeaderClass<Type>() && matchName(key))
201 result.
set(count,
io);
218template<
class MatchPredicate>
222 const MatchPredicate& matchName
229 const word& key = iter.key();
248template<
class MatchPredicate1,
class MatchPredicate2>
252 const MatchPredicate1& matchClass,
253 const MatchPredicate2& matchName
260 const word& key = iter.key();
263 if (matchClass(
io->headerClassName()) && matchName(key))
279template<
class Type,
class MatchPredicate>
283 const MatchPredicate& matchName
290 const word& key = iter.key();
293 if (
io->isHeaderClass<Type>() && matchName(key))
323 else if (
auto iter = cfind(objName); iter.good())
332 if (
io->isHeaderClass<Type>())
339 <<
" with different type" <<
endl;
348 if (
io &&
io->isHeaderClass<Type>())
381template<
class MatchPredicate>
384 const MatchPredicate& matchName
387 return lookupImpl(*
this, matchName);
391template<
class MatchPredicate>
394 const MatchPredicate& matchClass
401template<
class MatchPredicate1,
class MatchPredicate2>
404 const MatchPredicate1& matchClass,
405 const MatchPredicate2& matchName
408 return lookupClassImpl(*
this, matchClass, matchName);
419template<
class Type,
class MatchPredicate>
422 const MatchPredicate& matchName
425 return lookupClassImpl<Type>(*
this, matchName);
429template<
class MatchPredicate>
433 const MatchPredicate& matchName
436 return classesImpl(*
this, matchName);
440template<
class MatchPredicate>
443 const MatchPredicate& matchClass
450template<
class MatchPredicate1,
class MatchPredicate2>
453 const MatchPredicate1& matchClass,
454 const MatchPredicate2& matchName
457 return countImpl(*
this, matchClass, matchName);
468template<
class Type,
class MatchPredicate>
471 const MatchPredicate& matchName
474 return countTypeImpl<Type>(*
this, matchName);
509 checkObjectOrder(list, syncPar);
515template<
class Type,
class MatchPredicate>
519 const MatchPredicate& matchName
523 return objectsTypeImpl<Type>(*
this, matchName,
false);
527template<
class Type,
class MatchPredicate>
531 const MatchPredicate& matchName
535 return objectsTypeImpl<Type>(*
this, matchName,
true);
539template<
class Type,
class MatchPredicate>
543 const MatchPredicate& matchName,
550 objectsTypeImpl<Type>(*
this, matchName,
true)
553 checkObjectOrder(list, syncPar);
561template<
class MatchPredicate>
564 const MatchPredicate& matchClass
572template<
class MatchPredicate>
575 const MatchPredicate& matchClass,
583template<
class MatchPredicate1,
class MatchPredicate2>
586 const MatchPredicate1& matchClass,
587 const MatchPredicate2& matchName
591 return namesImpl(*
this, matchClass, matchName,
false);
595template<
class MatchPredicate1,
class MatchPredicate2>
598 const MatchPredicate1& matchClass,
599 const MatchPredicate2& matchName,
603 return sortedNames(matchClass, matchName, syncPar);
622template<
class Type,
class MatchPredicate>
625 const MatchPredicate& matchName
629 return namesTypeImpl<Type>(*
this, matchName,
false);
633template<
class Type,
class MatchPredicate>
636 const MatchPredicate& matchName,
646template<
class MatchPredicate>
649 const MatchPredicate& matchClass
656template<
class MatchPredicate>
659 const MatchPredicate& matchClass,
668 checkNameOrder(objNames, syncPar);
673template<
class MatchPredicate1,
class MatchPredicate2>
676 const MatchPredicate1& matchClass,
677 const MatchPredicate2& matchName
680 return namesImpl(*
this, matchClass, matchName,
true);
684template<
class MatchPredicate1,
class MatchPredicate2>
687 const MatchPredicate1& matchClass,
688 const MatchPredicate2& matchName,
692 wordList objNames(namesImpl(*
this, matchClass, matchName,
true));
694 checkNameOrder(objNames, syncPar);
711 checkNameOrder(objNames, syncPar);
716template<
class Type,
class MatchPredicate>
719 const MatchPredicate& matchName
722 return namesTypeImpl<Type>(*
this, matchName,
true);
726template<
class Type,
class MatchPredicate>
729 const MatchPredicate& matchName,
733 wordList objNames(namesTypeImpl<Type>(*
this, matchName,
true));
735 checkNameOrder(objNames, syncPar);
742template<
class UnaryPredicate>
745 const UnaryPredicate& pred,
762 for (
iterator iter = begin(); iter != end(); ++iter)
767 (pred(iter.val()->headerClassName()) ? pruning : !pruning)
779template<
class UnaryPredicate>
782 const UnaryPredicate& pred,
795 for (iterator iter = begin(); iter != end(); ++iter)
800 (pred(iter.key()) ? pruning : !pruning)
815 wordList objNames(namesTypeImpl<Type>(*
this, predicates::always(),
false));
bool erase(iterator &iter)
bool set(const Key &key, T *ptr)
Assign a new entry, overwrites existing.
Forward iterator with non-const access.
A HashTable similar to std::unordered_map.
iterator begin()
iterator set to the beginning of the HashTable
const_iterator cfind(const Key &key) const
Find and return an const_iterator set at the hashed entry.
void reserve(label numEntries)
Reserve space for at least the specified number of elements (not the number of buckets) and regenerat...
bool insert(const Key &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
label size() const noexcept
The number of elements in table.
iterator end() noexcept
iterator to signal the end (for any HashTable)
List of IOobjects with searching and retrieving facilities. Implemented as a HashTable,...
const IOobject * findObject(const word &objName) const
Return const pointer to the object found by name.
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.
label filterClasses(const UnaryPredicate &pred, const bool pruning=false)
Filter to retain or prune given classes.
const IOobject * cfindObject(const word &objName) const
Return const pointer to the object found by name.
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...
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() noexcept=default
Default construct: empty without allocation (capacity=0).
label filterObjects(const UnaryPredicate &pred, const bool pruning=false)
Filter to retain or prune given object names.
UPtrList< const IOobject > csorted() const
The sorted list of IOobjects with headerClassName == Type::typeName.
wordList allNames() const
The sorted names of all objects (synchronised across processors).
label count() const
The number of objects with headerClassName == Type::typeName.
IOobjectList lookupClass() const
The list of IOobjects with headerClassName == Type::typeName.
wordList names() const
The unsorted names of the IOobjects.
label count(const char *clsName) const
The number of objects of the given headerClassName.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
void resize(const label len)
Adjust allocated size of list.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie,...
void resize(const label newLen)
Change the size of the list. Any new entries are nullptr.
A class for handling words, derived from Foam::string.
#define InfoInFunction
Report an information message using Foam::Info.
List< word > wordList
List of word.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void sort(UList< T > &list)
Sort the list.
#define forAllConstIters(container, iter)
Iterate across all elements of the container object with const access.
Extract name (as a word) from an object, typically using its name() method.
Unary and binary predicates that always return true, useful for templating.