34 template<
class MatchPredicate>
38 const MatchPredicate& matchName
61 template<
class MatchPredicate1,
class MatchPredicate2>
62 Foam::label Foam::IOobjectList::countImpl
65 const MatchPredicate1& matchClass,
66 const MatchPredicate2& matchName
86 template<
class Type,
class MatchPredicate>
87 Foam::label Foam::IOobjectList::countTypeImpl
90 const MatchPredicate& matchName
110 template<
class MatchPredicate1,
class MatchPredicate2>
114 const MatchPredicate1& matchClass,
115 const MatchPredicate2& matchName,
134 objNames.resize(
count);
146 template<
class Type,
class MatchPredicate>
150 const MatchPredicate& matchName,
169 objNames.resize(
count);
181 template<
class Type,
class MatchPredicate>
183 Foam::IOobjectList::objectsTypeImpl
186 const MatchPredicate& matchName
204 result.resize(
count);
213 template<
class MatchPredicate>
217 const MatchPredicate& matchName
243 template<
class MatchPredicate1,
class MatchPredicate2>
247 const MatchPredicate1& matchClass,
248 const MatchPredicate2& matchName
274 template<
class Type,
class MatchPredicate>
278 const MatchPredicate& matchName
314 const const_iterator iter(cfind(objName));
331 <<
" with different type" <<
endl;
355 return cfindObject<Type>(objName);
362 return const_cast<IOobject*
>(cfindObject<Type>(objName));
369 return const_cast<IOobject*
>(cfindObject<Type>(objName));
373 template<
class MatchPredicate>
376 const MatchPredicate& matchName
379 return lookupImpl(*
this, matchName);
383 template<
class MatchPredicate>
386 const MatchPredicate& matchClass
393 template<
class MatchPredicate1,
class MatchPredicate2>
396 const MatchPredicate1& matchClass,
397 const MatchPredicate2& matchName
400 return lookupClassImpl(*
this, matchClass, matchName);
411 template<
class Type,
class MatchPredicate>
414 const MatchPredicate& matchName
417 return lookupClassImpl<Type>(*
this, matchName);
421 template<
class MatchPredicate>
425 const MatchPredicate& matchName
428 return classesImpl(*
this, matchName);
432 template<
class MatchPredicate>
435 const MatchPredicate& matchClass
442 template<
class MatchPredicate1,
class MatchPredicate2>
445 const MatchPredicate1& matchClass,
446 const MatchPredicate2& matchName
449 return countImpl(*
this, matchClass, matchName);
460 template<
class Type,
class MatchPredicate>
463 const MatchPredicate& matchName
466 return countTypeImpl<Type>(*
this, matchName);
490 checkObjectOrder(list, syncPar);
496 template<
class Type,
class MatchPredicate>
500 const MatchPredicate& matchName
503 return objectsTypeImpl<Type>(*
this, matchName);
507 template<
class Type,
class MatchPredicate>
511 const MatchPredicate& matchName,
517 objectsTypeImpl<Type>(*
this, matchName)
520 checkObjectOrder(list, syncPar);
528 template<
class MatchPredicate>
531 const MatchPredicate& matchClass
538 template<
class MatchPredicate>
541 const MatchPredicate& matchClass,
545 return sortedNames(matchClass, syncPar);
549 template<
class MatchPredicate1,
class MatchPredicate2>
552 const MatchPredicate1& matchClass,
553 const MatchPredicate2& matchName
556 return namesImpl(*
this, matchClass, matchName,
false);
560 template<
class MatchPredicate1,
class MatchPredicate2>
563 const MatchPredicate1& matchClass,
564 const MatchPredicate2& matchName,
568 return sortedNames(matchClass, matchName, syncPar);
582 return sortedNames<Type>(syncPar);
586 template<
class Type,
class MatchPredicate>
589 const MatchPredicate& matchName
592 return namesTypeImpl<Type>(*
this, matchName,
false);
596 template<
class Type,
class MatchPredicate>
599 const MatchPredicate& matchName,
603 return sortedNames<Type>(matchName, syncPar);
609 template<
class MatchPredicate>
612 const MatchPredicate& matchClass
619 template<
class MatchPredicate>
622 const MatchPredicate& matchClass,
631 checkNameOrder(objNames, syncPar);
636 template<
class MatchPredicate1,
class MatchPredicate2>
639 const MatchPredicate1& matchClass,
640 const MatchPredicate2& matchName
643 return namesImpl(*
this, matchClass, matchName,
true);
647 template<
class MatchPredicate1,
class MatchPredicate2>
650 const MatchPredicate1& matchClass,
651 const MatchPredicate2& matchName,
655 wordList objNames(namesImpl(*
this, matchClass, matchName,
true));
657 checkNameOrder(objNames, syncPar);
674 checkNameOrder(objNames, syncPar);
679 template<
class Type,
class MatchPredicate>
682 const MatchPredicate& matchName
685 return namesTypeImpl<Type>(*
this, matchName,
true);
689 template<
class Type,
class MatchPredicate>
692 const MatchPredicate& matchName,
696 wordList objNames(namesTypeImpl<Type>(*
this, matchName,
true));
698 checkNameOrder(objNames, syncPar);
705 template<
class UnaryPredicate>
708 const UnaryPredicate& pred,
725 for (iterator iter =
begin(); iter !=
end(); ++iter)
730 (pred(iter.val()->headerClassName()) ? pruning : !pruning)
742 template<
class UnaryPredicate>
745 const UnaryPredicate& pred,
758 for (iterator iter =
begin(); iter !=
end(); ++iter)
763 (pred(iter.key()) ? pruning : !pruning)
778 wordList objNames(namesTypeImpl<Type>(*
this, predicates::always(),
false));
label filterClasses(const UnaryPredicate &pred, const bool pruning=false)
Filter to retain or prune given classes.
List of IOobjects with searching and retrieving facilities. Implemented as a HashTable, so the various sorted methods should be used if traversing in parallel.
const word & name() const noexcept
Return the object name.
UPtrList< const IOobject > sorted() const
The sorted list of IOobjects.
IOobjectList lookupClass() const
The list of IOobjects with headerClassName == Type::typeName.
wordList sortedNames() const
The sorted names of the IOobjects.
Ostream & endl(Ostream &os)
Add newline and flush stream.
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.
label size() const noexcept
The number of elements in table.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
Unary and binary predicates that always return true, useful for templating.
A class for handling words, derived from Foam::string.
void sort(UList< T > &list)
Sort 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...
int debug
Static debugging option.
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
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...
List< word > wordList
List of word.
const word & headerClassName() const noexcept
Return name of the class name read from header.
bool insert(const word &, IOobject *)=delete
No insert() with raw pointers (potential memory leaks). Use insert() with autoPtr or set() ...
label count() const
The number of objects with headerClassName == Type::typeName.
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
label filterObjects(const UnaryPredicate &pred, const bool pruning=false)
Filter to retain or prune given object names.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
constexpr auto begin(C &c) -> decltype(c.begin())
Return iterator to the beginning of the container c.
Defines the attributes of an object for which implicit objectRegistry management is supported...
forAllConstIters(mixture.phases(), phase)
bool isHeaderClass() const
Check if headerClassName() equals Type::typeName.
HashTable< wordHashSet > classes() const
A summary hash of classes used and their associated object names.
#define InfoInFunction
Report an information message using Foam::Info.
const IOobject * cfindObject(const word &objName) const
Return const pointer to the object found by name.