Loading...
Searching...
No Matches
IOobjectList Class Reference

List of IOobjects with searching and retrieving facilities. Implemented as a HashTable, so the various sorted methods should be used if traversing in parallel. More...

#include <IOobjectList.H>

Inheritance diagram for IOobjectList:
Collaboration diagram for IOobjectList:

Public Member Functions

 IOobjectList () noexcept=default
 Default construct: empty without allocation (capacity=0).
 IOobjectList (Foam::zero) noexcept
 Construct empty without allocation (capacity=0).
 IOobjectList (const label initialCapacity)
 Construct empty with initial table capacity.
 IOobjectList (const IOobjectList &list)
 Copy construct.
 IOobjectList (IOobjectList &&list) noexcept
 Move construct.
 IOobjectList (const objectRegistry &db, const fileName &instance, IOobjectOption ioOpt)
 Construct from registry, instance, io options.
 IOobjectList (const objectRegistry &db, const fileName &instance, const fileName &local, IOobjectOption ioOpt)
 Construct from registry, instance, local, io options.
 IOobjectList (const objectRegistry &db, const fileName &instance, IOobjectOption::registerOption=IOobjectOption::REGISTER)
 Construct from registry, instance, registration option with MUST_READ, NO_WRITE.
 IOobjectList (const objectRegistry &db, const fileName &instance, const fileName &local, IOobjectOption::registerOption=IOobjectOption::REGISTER)
 Construct from registry, instance, local, registration option with MUST_READ, NO_WRITE.
 ~IOobjectList ()=default
 Destructor.
bool add (std::unique_ptr< IOobject > &&objectPtr)
 Move insert IOobject into the list.
bool add (autoPtr< IOobject > &objectPtr)
 Move insert IOobject into the list.
bool add (autoPtr< IOobject > &&objectPtr)
 Move insert IOobject into the list.
autoPtr< IOobjectremove (const IOobject &io)
 Remove object from the list by its IOobject::name().
const IOobjectcfindObject (const word &objName) const
 Return const pointer to the object found by name.
template<class Type>
const IOobjectcfindObject (const word &objName) const
 Return const pointer to the object found by name that also has headerClassName == Type::typeName.
const IOobjectfindObject (const word &objName) const
 Return const pointer to the object found by name.
template<class Type>
const IOobjectfindObject (const word &objName) const
 Return const pointer to the object found by name that also has headerClassName == Type::typeName.
IOobjectfindObject (const word &objName)
 Return non-const pointer to the object found by name.
template<class Type>
IOobjectfindObject (const word &objName)
 Return non-const pointer to the object found by name that also has headerClassName == Type::typeName.
IOobjectgetObject (const word &objName) const
 Return non-const pointer to the object found by name, using a const-cast to have it behave like a mutable.
template<class Type>
IOobjectgetObject (const word &objName) const
 Return non-const pointer to the object found by name that also has headerClassName == Type::typeName, using a const-cast to have it behave like a mutable.
template<class MatchPredicate>
IOobjectList lookup (const MatchPredicate &matchName) const
 The list of IOobjects that have a matching object name.
IOobjectList lookupClass (const char *clsName) const
 The list of IOobjects with the given headerClassName.
template<class MatchPredicate>
IOobjectList lookupClass (const MatchPredicate &matchClass) const
 The list of IOobjects with matching headerClassName.
template<class MatchPredicate1, class MatchPredicate2>
IOobjectList lookupClass (const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName) const
 The list of IOobjects with matching headerClassName that also have a matching object name.
template<class Type>
IOobjectList lookupClass () const
 The list of IOobjects with headerClassName == Type::typeName.
template<class Type, class MatchPredicate>
IOobjectList lookupClass (const MatchPredicate &matchName) const
 The list of IOobjects with headerClassName == Type::typeName that also have a matching object name.
HashTable< wordHashSetclasses () const
 A summary hash of classes used and their associated object names.
template<class MatchPredicate>
HashTable< wordHashSetclasses (const MatchPredicate &matchName) const
 A summary hash of classes used and their associated object names, restricted to objects that have a matching object name.
template<class Type>
UPtrList< const IOobjectcobjects () const
 The unsorted list of IOobjects with headerClassName == Type::typeName.
template<class Type, class MatchPredicate>
UPtrList< const IOobjectcobjects (const MatchPredicate &matchName) const
 The unsorted list of IOobjects with headerClassName == Type::typeName that also have a matching object name.
template<class Type>
UPtrList< const IOobjectcsorted () const
 The sorted list of IOobjects with headerClassName == Type::typeName.
template<class Type>
UPtrList< const IOobjectcsorted (const bool syncPar) const
 The sorted names of the IOobjects with optional check for parallel consistency.
UPtrList< const IOobjectcsorted () const
 The sorted list of IOobjects.
UPtrList< const IOobjectcsorted (const bool syncPar) const
 The sorted list of IOobjects with optional check for parallel consistency.
template<class Type, class MatchPredicate>
UPtrList< const IOobjectcsorted (const MatchPredicate &matchName) const
 The sorted list of IOobjects with headerClassName == Type::typeName that also have a matching object name.
template<class Type, class MatchPredicate>
UPtrList< const IOobjectcsorted (const MatchPredicate &matchName, const bool syncPar) const
 The sorted list of IOobjects with headerClassName == Type::typeName that also have a matching object name.
label count (const char *clsName) const
 The number of objects of the given headerClassName.
template<class MatchPredicate>
label count (const MatchPredicate &matchClass) const
 The number of objects of the given headerClassName.
template<class MatchPredicate1, class MatchPredicate2>
label count (const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName) const
 The number of objects of the given headerClassName that also have a matching object name.
template<class Type>
label count () const
 The number of objects with headerClassName == Type::typeName.
template<class Type, class MatchPredicate>
label count (const MatchPredicate &matchName) const
 The number of objects with headerClassName == Type::typeName that also have a matching object name.
wordList names () const
 The unsorted names of the IOobjects.
wordList names (const bool syncPar) const
 The sorted names of the IOobjects with optional check for parallel consistency.
wordList names (const char *clsName) const
 The unsorted names of IOobjects with the given headerClassName.
wordList names (const char *clsName, const bool syncPar) const
 The sorted names of the IOobjects with the given headerClassName.
template<class MatchPredicate>
wordList names (const MatchPredicate &matchClass) const
 The unsorted names of IOobjects with the given headerClassName.
template<class MatchPredicate>
wordList names (const MatchPredicate &matchClass, const bool syncPar) const
 The sorted names of the IOobjects with the given headerClassName.
template<class MatchPredicate1, class MatchPredicate2>
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.
template<class MatchPredicate1, class MatchPredicate2>
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 name.
template<class Type>
wordList names () const
 The unsorted names of objects with headerClassName == Type::typeName.
template<class Type>
wordList names (bool syncPar) const
 The sorted names of objects with headerClassName == Type::typeName.
template<class Type, class MatchPredicate>
wordList names (const MatchPredicate &matchName) const
 The unsorted names of objects with headerClassName == Type::typeName and a matching object name.
template<class Type, class MatchPredicate>
wordList names (const MatchPredicate &matchName, const bool syncPar) const
 The sorted names of objects with headerClassName == Type::typeName and a matching object name.
wordList sortedNames () const
 The sorted names of the IOobjects.
wordList sortedNames (const bool syncPar) const
 The sorted names of the IOobjects with optional check for parallel consistency.
wordList sortedNames (const char *clsName) const
 The sorted names of IOobjects with the given headerClassName.
wordList sortedNames (const char *clsName, const bool syncPar) const
 The sorted names of the IOobjects with the given headerClassName.
template<class MatchPredicate>
wordList sortedNames (const MatchPredicate &matchClass) const
 The sorted names of IOobjects with the given headerClassName.
template<class MatchPredicate>
wordList sortedNames (const MatchPredicate &matchClass, const bool syncPar) const
 The sorted names of the IOobjects with the given headerClassName.
template<class MatchPredicate1, class MatchPredicate2>
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.
template<class MatchPredicate1, class MatchPredicate2>
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 name.
template<class Type>
wordList sortedNames () const
 The sorted names of objects with headerClassName == Type::typeName.
template<class Type>
wordList sortedNames (bool syncPar) const
 The sorted names of objects with headerClassName == Type::typeName.
template<class Type, class MatchPredicate>
wordList sortedNames (const MatchPredicate &matchName) const
 The sorted names of objects with headerClassName == Type::typeName that also have a matching object name.
template<class Type, class MatchPredicate>
wordList sortedNames (const MatchPredicate &matchName, const bool syncPar) const
 The sorted names of objects with headerClassName == Type::typeName that also have a matching object name.
template<class UnaryPredicate>
label filterClasses (const UnaryPredicate &pred, const bool pruning=false)
 Filter to retain or prune given classes.
template<class UnaryPredicate>
label filterObjects (const UnaryPredicate &pred, const bool pruning=false)
 Filter to retain or prune given object names.
label prune_0 ()
 Remove objects with names ending with "_0" (restart fields).
wordList allNames () const
 The sorted names of all objects (synchronised across processors).
template<class Type>
wordList allNames () const
 The sorted names of all objects (synchronised across processors) with headerClassName == Type::typeName.
void checkNames (const bool syncPar=true) const
 Verify that object names are synchronised across processors.
void operator= (const IOobjectList &)=delete
 No copy assignment.
void operator= (IOobjectList &&list)
 Move assignment.
 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.
IOobjectlookup (const char *objName) const
 Deprecated(2018-11) Locate an object by name (c-string). Disambiguated from multiple-lookup version by calling parameter.
IOobjectlookup (const word &objName) const
 Deprecated(2018-11) Locate an object by name (const word&). Disambiguated from multiple-lookup version by calling parameter.
template<class Type>
UPtrList< const IOobjectsorted () const
 Deprecated(2023-07) use csorted() method.
template<class Type>
UPtrList< const IOobjectsorted (const bool syncPar) const
 Deprecated(2023-07) use csorted() method.
UPtrList< const IOobjectsorted () const
 Deprecated(2023-07) use csorted() method.
UPtrList< const IOobjectsorted (const bool syncPar) const
 Deprecated(2023-07) use csorted() method.
template<class Type, class MatchPredicate>
UPtrList< const IOobjectsorted (const MatchPredicate &matchName) const
 Deprecated(2023-07) use csorted() method.
template<class Type, class MatchPredicate>
UPtrList< const IOobjectsorted (const MatchPredicate &matchName, const bool syncPar) const
 Deprecated(2023-07) use csorted() method.
template<class MatchPredicate>
Foam::HashTable< Foam::wordHashSetclassesImpl (const IOobjectList &list, const MatchPredicate &matchName)
template<class MatchPredicate1, class MatchPredicate2>
Foam::label countImpl (const IOobjectList &list, const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName)
template<class Type, class MatchPredicate>
Foam::label countTypeImpl (const IOobjectList &list, const MatchPredicate &matchName)
template<class MatchPredicate1, class MatchPredicate2>
Foam::wordList namesImpl (const IOobjectList &list, const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName, const bool doSort)
template<class Type, class MatchPredicate>
Foam::wordList namesTypeImpl (const IOobjectList &list, const MatchPredicate &matchName, const bool doSort)
template<class Type, class MatchPredicate>
Foam::UPtrList< const Foam::IOobjectobjectsTypeImpl (const IOobjectList &list, const MatchPredicate &matchName, const bool doSort)
template<class MatchPredicate>
Foam::IOobjectList lookupImpl (const IOobjectList &list, const MatchPredicate &matchName)
template<class MatchPredicate1, class MatchPredicate2>
Foam::IOobjectList lookupClassImpl (const IOobjectList &list, const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName)
template<class Type, class MatchPredicate>
Foam::IOobjectList lookupClassTypeImpl (const IOobjectList &list, const MatchPredicate &matchName)
template<class Type>
const Foam::IOobjectcfindObject (const word &objName) const
template<class Type>
const Foam::IOobjectfindObject (const word &objName) const
template<class Type>
Foam::IOobjectfindObject (const word &objName)
template<class Type>
Foam::IOobjectgetObject (const word &objName) const
template<class MatchPredicate>
Foam::IOobjectList lookup (const MatchPredicate &matchName) const
template<class MatchPredicate>
Foam::IOobjectList lookupClass (const MatchPredicate &matchClass) const
template<class MatchPredicate1, class MatchPredicate2>
Foam::IOobjectList lookupClass (const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName) const
template<class Type>
Foam::IOobjectList lookupClass () const
template<class Type, class MatchPredicate>
Foam::IOobjectList lookupClass (const MatchPredicate &matchName) const
template<class MatchPredicate>
Foam::HashTable< Foam::wordHashSetclasses (const MatchPredicate &matchName) const
template<class MatchPredicate>
Foam::label count (const MatchPredicate &matchClass) const
template<class MatchPredicate1, class MatchPredicate2>
Foam::label count (const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName) const
template<class Type>
Foam::label count () const
template<class Type, class MatchPredicate>
Foam::label count (const MatchPredicate &matchName) const
template<class Type>
Foam::UPtrList< const Foam::IOobjectcobjects () const
template<class Type>
Foam::UPtrList< const Foam::IOobjectcsorted () const
template<class Type>
Foam::UPtrList< const Foam::IOobjectcsorted (const bool syncPar) const
template<class Type, class MatchPredicate>
Foam::UPtrList< const Foam::IOobjectcobjects (const MatchPredicate &matchName) const
template<class Type, class MatchPredicate>
Foam::UPtrList< const Foam::IOobjectcsorted (const MatchPredicate &matchName) const
template<class Type, class MatchPredicate>
Foam::UPtrList< const Foam::IOobjectcsorted (const MatchPredicate &matchName, const bool syncPar) const
template<class MatchPredicate>
Foam::wordList names (const MatchPredicate &matchClass) const
template<class MatchPredicate>
Foam::wordList names (const MatchPredicate &matchClass, const bool syncPar) const
template<class MatchPredicate1, class MatchPredicate2>
Foam::wordList names (const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName) const
template<class MatchPredicate1, class MatchPredicate2>
Foam::wordList names (const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName, const bool syncPar) const
template<class Type>
Foam::wordList names () const
template<class Type>
Foam::wordList names (const bool syncPar) const
template<class Type, class MatchPredicate>
Foam::wordList names (const MatchPredicate &matchName) const
template<class Type, class MatchPredicate>
Foam::wordList names (const MatchPredicate &matchName, const bool syncPar) const
template<class MatchPredicate>
Foam::wordList sortedNames (const MatchPredicate &matchClass) const
template<class MatchPredicate>
Foam::wordList sortedNames (const MatchPredicate &matchClass, const bool syncPar) const
template<class MatchPredicate1, class MatchPredicate2>
Foam::wordList sortedNames (const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName) const
template<class MatchPredicate1, class MatchPredicate2>
Foam::wordList sortedNames (const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName, const bool syncPar) const
template<class Type>
Foam::wordList sortedNames () const
template<class Type>
Foam::wordList sortedNames (const bool syncPar) const
template<class Type, class MatchPredicate>
Foam::wordList sortedNames (const MatchPredicate &matchName) const
template<class Type, class MatchPredicate>
Foam::wordList sortedNames (const MatchPredicate &matchName, const bool syncPar) const
template<class UnaryPredicate>
Foam::label filterClasses (const UnaryPredicate &pred, const bool pruning)
template<class UnaryPredicate>
Foam::label filterObjects (const UnaryPredicate &pred, const bool pruning)
template<class Type>
Foam::wordList allNames () const
Public Member Functions inherited from HashPtrTable< IOobject >
constexpr HashPtrTable () noexcept=default
 Default construct: empty without allocation (capacity=0).
 ~HashPtrTable ()
 Destructor.
const IOobjecttest (const word &key) const
 Return const pointer associated with given entry or a nullptr if the key does not exist in the table.
const IOobjectget (const word &key) const
 Return const pointer associated with given entry or a nullptr if the key does not exist in the table.
autoPtr< IOobjectrelease (iterator &iter)
 Release ownership of the pointer and replace with a nullptr.
autoPtr< IOobjectremove (iterator &iter)
 Remove entry specified by given iterator.
bool erase (iterator &iter)
 Erase entry specified by given iterator and delete the allocated pointer.
void clear ()
 Clear all entries from table and delete any allocated pointers.
void merge (HashPtrTable< IOobject, word, Foam::Hash< word > > &source)
 Attempts to extract entries from source parameter and insert them into this, does not overwrite existing entries. The source will contains any items that could not be merged.
void write (Ostream &os) const
 Invoke write() on each non-null entry.
void operator= (const this_type &rhs)
 Copy assignment.
bool emplace (const word &key, Args &&... args)
 Emplace insert a new entry, not overwriting existing entries.
IOobjectemplace_set (const word &key, Args &&... args)
 Emplace set an entry, overwriting any existing entries.
IOobjecttry_emplace (const word &key, Args &&... args)
 Like emplace_set() but will not overwrite an occupied (non-null) location.
bool insert (const word &, IOobject *)=delete
 No insert() with raw pointers (potential memory leaks). Use insert() with autoPtr or set().
bool set (const word &key, IOobject *ptr)
 Assign a new entry, overwrites existing.
Public Member Functions inherited from HashTable< T, Key, Hash >
constexpr HashTable () noexcept
 Default construct: empty without allocation (capacity=0).
constexpr HashTable (Foam::zero) noexcept
 Construct empty without allocation (capacity=0).
 HashTable (const label initialCapacity)
 Construct empty with initial table capacity.
 HashTable (Istream &is)
 Construct from Istream.
 HashTable (const this_type &ht)
 Copy construct.
 HashTable (this_type &&rhs) noexcept
 Move construct.
 HashTable (std::initializer_list< std::pair< Key, T > > list, const bool overwrite=false)
 Construct from key/value pairs in initializer list.
 HashTable (const UList< Key > &keys, const UList< T > &values, const bool overwrite=false)
 Construct from key/value pairs.
 ~HashTable ()
 Destructor.
bool empty () const noexcept
 True if the hash table is empty.
label size () const noexcept
 The number of elements in table.
label capacity () const noexcept
 The size of the underlying table (the number of buckets).
Tat (const Key &key)
 Find and return a hashed entry. FatalError if it does not exist.
const Tat (const Key &key) const
 Find and return a hashed entry. FatalError if it does not exist.
bool contains (const Key &key) const
 True if hashed key is contained (found) in table.
iterator find (const Key &key)
 Find and return an iterator set at the hashed entry.
const_iterator find (const Key &key) const
 Find and return an const_iterator set at the hashed entry.
const_iterator cfind (const Key &key) const
 Find and return an const_iterator set at the hashed entry.
const Tlookup (const Key &key, const T &deflt) const
 Return hashed entry if it exists, or return the given default.
List< Key > toc () const
 The table of contents (the keys) in unsorted order.
List< Key > sortedToc () const
 The table of contents (the keys) in sorted order.
template<class Compare>
List< Key > sortedToc (const Compare &comp) const
 The table of contents (the keys) sorted according to the specified comparator.
template<class UnaryPredicate>
List< Key > tocKeys (const UnaryPredicate &pred, const bool invert=false) const
 The table of contents (the keys) selected according to the unary predicate applied to the keys.
template<class UnaryPredicate>
List< Key > tocValues (const UnaryPredicate &pred, const bool invert=false) const
 The table of contents (the keys) selected according to the unary predicate applied to the values.
template<class BinaryPredicate>
List< Key > tocEntries (const BinaryPredicate &pred, const bool invert=false) const
 The table of contents (the keys) selected according to the binary predicate applied to the keys and values.
UPtrList< const node_typecsorted () const
 Const access to the hash-table contents in sorted order (sorted by keys).
UPtrList< node_typesorted ()
 Non-const access to the hash-table contents in sorted order (sorted by keys).
template<class UnaryPredicate>
label countKeys (const UnaryPredicate &pred, const bool invert=false) const
 Count the number of keys that satisfy the unary predicate.
template<class UnaryPredicate>
label countValues (const UnaryPredicate &pred, const bool invert=false) const
 Count the number of values that satisfy the unary predicate.
template<class BinaryPredicate>
label countEntries (const BinaryPredicate &pred, const bool invert=false) const
 Count the number of entries that satisfy the binary predicate.
template<class... Args>
bool emplace (const Key &key, Args &&... args)
 Emplace insert a new entry, not overwriting existing entries.
template<class... Args>
bool emplace_set (const Key &key, Args &&... args)
 Emplace set an entry, overwriting any existing entries.
bool insert (const Key &key, const T &obj)
 Copy insert a new entry, not overwriting existing entries.
bool insert (const Key &key, T &&obj)
 Move insert a new entry, not overwriting existing entries.
bool set (const Key &key, const T &obj)
 Copy assign a new entry, overwriting existing entries.
bool set (const Key &key, T &&obj)
 Move assign a new entry, overwriting existing entries.
bool erase (const iterator &iter)
 Erase an entry specified by given iterator.
bool erase (const Key &key)
 Erase an entry specified by the given key.
template<class AnyType, class AnyHash>
label erase (const HashTable< AnyType, Key, AnyHash > &other)
 Remove table entries given by keys of the other hash-table.
label erase (std::initializer_list< Key > keys)
 Remove table entries given by the listed keys.
template<class InputIter>
label erase (InputIter first, InputIter last)
 Remove multiple entries using an iterator range of keys.
template<unsigned N>
label erase (const FixedList< Key, N > &keys)
 Remove table entries given by the listed keys.
label erase (const UList< Key > &keys)
 Remove table entries given by the listed keys.
template<class AnyType, class AnyHash>
label retain (const HashTable< AnyType, Key, AnyHash > &other)
 Retain table entries given by keys of the other hash-table.
template<class UnaryPredicate>
label filterKeys (const UnaryPredicate &pred, const bool pruning=false)
 Generalized means to filter table entries based on their keys.
template<class UnaryPredicate>
label filterValues (const UnaryPredicate &pred, const bool pruning=false)
 Generalized means to filter table entries based on their values.
template<class BinaryPredicate>
label filterEntries (const BinaryPredicate &pred, const bool pruning=false)
 Generalized means to filter table entries based on their key/value.
void clear ()
 Remove all entries from table.
void clearStorage ()
 Remove all entries from table and the table itself.
void setCapacity (label newCapacity)
 Change the hash table capacity (number of buckets).
void resize (label newCapacity)
 Rehash the hash table with new number of buckets. Currently identical to setCapacity().
void reserve (label numEntries)
 Reserve space for at least the specified number of elements (not the number of buckets) and regenerates the hash table.
void swap (HashTable< T, Key, Hash > &rhs) noexcept
 Swap contents into this table.
void transfer (HashTable< T, Key, Hash > &rhs)
 Transfer contents into this table.
void merge (HashTable< T, Key, Hash > &source)
 Attempts to extract entries from source parameter and insert them into this, does not overwrite existing entries. The source will contains any items that could not be merged.
void merge (HashTable< T, Key, Hash > &&source)
 Attempts to extract entries from source parameter and insert them into this, does not overwrite existing entries. The source will contains any items that could not be merged.
Toperator[] (const Key &key)
 Find and return a hashed entry. FatalError if it does not exist.
const Toperator[] (const Key &key) const
 Find and return a hashed entry. FatalError if it does not exist.
Toperator() (const Key &key)
 Return existing entry or create a new entry.
Toperator() (const Key &key, const T &deflt)
 Return existing entry or insert a new entry.
void operator= (const this_type &rhs)
 Copy assign.
void operator= (std::initializer_list< std::pair< Key, T > > rhs)
 Copy assign from an initializer list.
void operator= (this_type &&rhs)
 Move assign.
bool operator== (const this_type &rhs) const
 Equality. Tables are equal if all keys and values are equal, independent of order or underlying storage size.
bool operator!= (const this_type &rhs) const
 The opposite of the equality operation.
this_typeoperator+= (const this_type &rhs)
 Add entries into this HashTable.
const_iterator_pair< const_key_iterator, this_typekeys () const
 A const iterator begin/end pair for iterating over keys.
iterator begin ()
 iterator set to the beginning of the HashTable
const_iterator begin () const
 const_iterator set to the beginning of the HashTable
const_iterator cbegin () const
 const_iterator set to the beginning of the HashTable
iterator end () noexcept
 iterator to signal the end (for any HashTable)
const_iterator end () const noexcept
 const_iterator to signal the end (for any HashTable)
constexpr const_iterator cend () const noexcept
 const_iterator to signal the end (for any HashTable)
OstreamprintInfo (Ostream &os) const
 Print information.
OstreamwriteKeys (Ostream &os, const label shortLen=0) const
 Write unordered keys (list), with line-breaks when length exceeds shortLen.
bool found (const Key &key) const
 Same as contains().
UPtrList< const node_typesorted () const
 Deprecated(2023-07) use csorted() method.
template<class Compare>
Foam::List< Key > sortedToc (const Compare &comp) const
template<class UnaryPredicate>
Foam::List< Key > tocKeys (const UnaryPredicate &pred, const bool invert) const
template<class UnaryPredicate>
Foam::List< Key > tocValues (const UnaryPredicate &pred, const bool invert) const
template<class BinaryPredicate>
Foam::List< Key > tocEntries (const BinaryPredicate &pred, const bool invert) const
template<class UnaryPredicate>
Foam::label countKeys (const UnaryPredicate &pred, const bool invert) const
template<class UnaryPredicate>
Foam::label countValues (const UnaryPredicate &pred, const bool invert) const
template<class BinaryPredicate>
Foam::label countEntries (const BinaryPredicate &pred, const bool invert) const
template<class InputIter>
Foam::label erase (InputIter first, InputIter last)
template<unsigned N>
Foam::label erase (const FixedList< Key, N > &keys)
template<class AnyType, class AnyHash>
Foam::label erase (const HashTable< AnyType, Key, AnyHash > &other)
template<class AnyType, class AnyHash>
Foam::label retain (const HashTable< AnyType, Key, AnyHash > &other)
template<class UnaryPredicate>
Foam::label filterKeys (const UnaryPredicate &pred, const bool pruning)
template<class UnaryPredicate>
Foam::label filterValues (const UnaryPredicate &pred, const bool pruning)
template<class BinaryPredicate>
Foam::label filterEntries (const BinaryPredicate &pred, const bool pruning)
Public Member Functions inherited from HashTableCore
 ClassName ("HashTable")
 Declare type-name (with debug switch).
constexpr HashTableCore () noexcept=default
 Default construct.

Additional Inherited Members

Public Types inherited from HashPtrTable< IOobject >
typedef HashPtrTable< IOobject, word, Foam::Hash< word > > this_type
 The template instance used for this table.
typedef HashTable< IOobject *, word, Foam::Hash< word > > parent_type
 The template instance used for the parent HashTable.
using iterator
using const_iterator
Public Types inherited from HashTable< T, Key, Hash >
typedef HashTable< T, Key, Hashthis_type
 The template instance used for this HashTable.
using node_type
 A table entry (node) that encapsulates the key/val tuple with an additional linked-list entry for hash collisions.
typedef Key key_type
 The second template parameter, type of keys used.
typedef T mapped_type
 The first template parameter, type of objects contained.
typedef T value_type
 Same as mapped_type for OpenFOAM HashTables.
typedef Hash hasher
 The third template parameter, the hash index method.
typedef Tpointer
 Pointer type for storing into value_type objects.
typedef Treference
 Reference to the stored value_type.
typedef const Tconst_pointer
 Const pointer type for the stored value_type.
typedef const Tconst_reference
 Const reference to the stored value_type.
typedef label difference_type
 The type to represent the difference between two iterators.
typedef label size_type
 The type that can represent the size of a HashTable.
using key_iterator = key_iterator_base<iterator>
 Forward iterator returning the key.
using const_key_iterator = key_iterator_base<const_iterator>
 Forward const iterator returning the key.
Static Public Member Functions inherited from HashTableCore
static label canonicalSize (const label size) noexcept
 Return a canonical (power-of-two) of the requested size.
Static Public Attributes inherited from HashTableCore
static constexpr int32_t maxTableSize = (1 << (32-3))
 Maximum allowable internal table size (must be a power of two!).

Detailed Description

List of IOobjects with searching and retrieving facilities. Implemented as a HashTable, so the various sorted methods should be used if traversing in parallel.

Source files

Definition at line 55 of file IOobjectList.H.

Constructor & Destructor Documentation

◆ IOobjectList() [1/10]

◆ IOobjectList() [2/10]

IOobjectList ( Foam::zero )
inlineexplicitnoexcept

Construct empty without allocation (capacity=0).

Definition at line 201 of file IOobjectList.H.

References IOobjectList(), and Foam::noexcept.

Here is the call graph for this function:

◆ IOobjectList() [3/10]

IOobjectList ( const label initialCapacity)
inlineexplicit

Construct empty with initial table capacity.

Definition at line 23 of file IOobjectListI.H.

References HashPtrTable< IOobject >::HashPtrTable().

Here is the call graph for this function:

◆ IOobjectList() [4/10]

IOobjectList ( const IOobjectList & list)
inline

Copy construct.

Definition at line 29 of file IOobjectListI.H.

References HashPtrTable< IOobject >::HashPtrTable(), and IOobjectList().

Here is the call graph for this function:

◆ IOobjectList() [5/10]

IOobjectList ( IOobjectList && list)
inlinenoexcept

Move construct.

Definition at line 35 of file IOobjectListI.H.

References HashPtrTable< IOobject >::HashPtrTable(), IOobjectList(), and Foam::noexcept.

Here is the call graph for this function:

◆ IOobjectList() [6/10]

IOobjectList ( const objectRegistry & db,
const fileName & instance,
IOobjectOption ioOpt )
inline

Construct from registry, instance, io options.

Definition at line 41 of file IOobjectListI.H.

References IOobjectList().

Here is the call graph for this function:

◆ IOobjectList() [7/10]

IOobjectList ( const objectRegistry & db,
const fileName & instance,
const fileName & local,
IOobjectOption ioOpt )

Construct from registry, instance, local, io options.

Definition at line 90 of file IOobjectList.C.

References Foam::endl(), Foam::FatalIOError, Foam::fileHandler, insert(), local, autoPtr< T >::New(), Foam::nl, HashTable< T, Key, Hash >::reserve(), UList< T >::size(), and Foam::Warning.

Here is the call graph for this function:

◆ IOobjectList() [8/10]

IOobjectList ( const objectRegistry & db,
const fileName & instance,
IOobjectOption::registerOption registerObject = IOobjectOption::REGISTER )
inline

Construct from registry, instance, registration option with MUST_READ, NO_WRITE.

Definition at line 52 of file IOobjectListI.H.

References IOobjectList().

Here is the call graph for this function:

◆ IOobjectList() [9/10]

IOobjectList ( const objectRegistry & db,
const fileName & instance,
const fileName & local,
IOobjectOption::registerOption registerObject = IOobjectOption::REGISTER )
inline

Construct from registry, instance, local, registration option with MUST_READ, NO_WRITE.

Definition at line 74 of file IOobjectListI.H.

References IOobjectList(), and local.

Here is the call graph for this function:

◆ ~IOobjectList()

~IOobjectList ( )
default

Destructor.

References HashPtrTable< IOobject >::HashPtrTable(), and remove().

Here is the call graph for this function:

◆ IOobjectList() [10/10]

IOobjectList ( const objectRegistry & db,
const fileName & instance,
const fileName & local,
IOobjectOption::readOption rOpt,
IOobjectOption::writeOption wOpt = IOobjectOption::NO_WRITE,
bool registerObject = true )
inline

Construct from registry, instance, local, io options.

Deprecated
(2022-11) prefer IOobjectOption or registerOption

Definition at line 985 of file IOobjectList.H.

References IOobjectList(), local, and IOobjectOption::NO_WRITE.

Here is the call graph for this function:

Member Function Documentation

◆ add() [1/3]

bool add ( std::unique_ptr< IOobject > && objectPtr)
inline

Move insert IOobject into the list.

Definition at line 99 of file IOobjectListI.H.

References insert().

Here is the call graph for this function:

◆ add() [2/3]

bool add ( autoPtr< IOobject > & objectPtr)
inline

Move insert IOobject into the list.

Definition at line 110 of file IOobjectListI.H.

References insert().

Here is the call graph for this function:

◆ add() [3/3]

bool add ( autoPtr< IOobject > && objectPtr)
inline

Move insert IOobject into the list.

Definition at line 121 of file IOobjectListI.H.

References insert().

Here is the call graph for this function:

◆ remove()

autoPtr< IOobject > remove ( const IOobject & io)
inline

Remove object from the list by its IOobject::name().

Returns
autoPtr<IOobject>

Definition at line 302 of file IOobjectList.H.

References io, and remove().

Referenced by remove(), and ~IOobjectList().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cfindObject() [1/3]

const Foam::IOobject * cfindObject ( const word & objName) const

Return const pointer to the object found by name.

Returns
IOobject ptr if found else nullptr

Definition at line 145 of file IOobjectList.C.

References HashTable< T, Key, Hash >::cfind(), Foam::endl(), InfoInFunction, and io.

Referenced by findObject(), findObject(), and getObject().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cfindObject() [2/3]

template<class Type>
const IOobject * cfindObject ( const word & objName) const

Return const pointer to the object found by name that also has headerClassName == Type::typeName.

Returns
IOobject ptr if found and the correct type, else nullptr
Note
If Type is void, no headerClassName check is used (always true).

◆ findObject() [1/6]

const Foam::IOobject * findObject ( const word & objName) const

Return const pointer to the object found by name.

Returns
IOobject ptr if found else nullptr

Definition at line 178 of file IOobjectList.C.

References cfindObject().

Referenced by Foam::getField(), Foam::lumpedPointTools::lumpedPointPatchList(), Foam::lumpedPointTools::setInterpolators(), and Foam::lumpedPointTools::setPatchControls().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findObject() [2/6]

template<class Type>
const IOobject * findObject ( const word & objName) const

Return const pointer to the object found by name that also has headerClassName == Type::typeName.

Returns
IOobject ptr if found and the correct type, else nullptr
Note
If Type is void, no headerClassName check is used (always true).

◆ findObject() [3/6]

Foam::IOobject * findObject ( const word & objName)

Return non-const pointer to the object found by name.

Returns
IOobject ptr if found else nullptr

Definition at line 187 of file IOobjectList.C.

References cfindObject().

Here is the call graph for this function:

◆ findObject() [4/6]

template<class Type>
IOobject * findObject ( const word & objName)

Return non-const pointer to the object found by name that also has headerClassName == Type::typeName.

Returns
IOobject ptr if found and the correct type, else nullptr
Note
If Type is void, no headerClassName check is used (always true).

◆ getObject() [1/3]

Foam::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 mutable.

Exercise caution when using.

Returns
IOobject ptr if found else nullptr

Definition at line 193 of file IOobjectList.C.

References cfindObject().

Referenced by lookup(), and lookup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getObject() [2/3]

template<class Type>
IOobject * getObject ( const word & objName) const

Return non-const pointer to the object found by name that also has headerClassName == Type::typeName, using a const-cast to have it behave like a mutable.

Exercise caution when using.

Returns
IOobject ptr if found and the correct type, else nullptr
Note
If Type is void, no headerClassName check is used (always true).

◆ lookup() [1/4]

template<class MatchPredicate>
IOobjectList lookup ( const MatchPredicate & matchName) const

The list of IOobjects that have a matching object name.

References IOobjectList().

Here is the call graph for this function:

◆ lookupClass() [1/9]

Foam::IOobjectList lookupClass ( const char * clsName) const

The list of IOobjects with the given headerClassName.

Definition at line 199 of file IOobjectList.C.

References lookupClass().

Referenced by lookupClass().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lookupClass() [2/9]

template<class MatchPredicate>
IOobjectList lookupClass ( const MatchPredicate & matchClass) const

The list of IOobjects with matching headerClassName.

References IOobjectList().

Here is the call graph for this function:

◆ lookupClass() [3/9]

template<class MatchPredicate1, class MatchPredicate2>
IOobjectList lookupClass ( const MatchPredicate1 & matchClass,
const MatchPredicate2 & matchName ) const

The list of IOobjects with matching headerClassName that also have a matching object name.

References IOobjectList().

Here is the call graph for this function:

◆ lookupClass() [4/9]

template<class Type>
IOobjectList lookupClass ( ) const

The list of IOobjects with headerClassName == Type::typeName.

Note
If Type is void, no headerClassName check is used (always true).

References IOobjectList().

Here is the call graph for this function:

◆ lookupClass() [5/9]

template<class Type, class MatchPredicate>
IOobjectList lookupClass ( const MatchPredicate & matchName) const

The list of IOobjects with headerClassName == Type::typeName that also have a matching object name.

References IOobjectList().

Here is the call graph for this function:

◆ classes() [1/3]

Foam::HashTable< Foam::wordHashSet > classes ( ) const

A summary hash of classes used and their associated object names.

The HashTable representation allows us to leverage various HashTable methods. This hashed summary view can be useful when querying particular aspects. For example,

IOobjectList objects(runTime, runTime.timeName());
HashTable<wordHashSet> classes = objects.classes();
// How many volScalarField?
Info<< checkType << "="
<< (classes.contains(checkType) ? classes[checkType].size() : 0)
<< nl;
static const char *const typeName
Typename for Field.
Definition Field.H:93
A HashTable similar to std::unordered_map.
Definition HashTable.H:124
label size() const noexcept
The number of elements in table.
Definition HashTable.H:358
HashTable< wordHashSet > classes() const
A summary hash of classes used and their associated object names.
IOobjectList() noexcept=default
Default construct: empty without allocation (capacity=0).
A class for handling words, derived from Foam::string.
Definition word.H:66
engineTime & runTime
messageStream Info
Information stream (stdout output on master, null elsewhere).
constexpr char nl
The newline '\n' character (0x0a).
Definition Ostream.H:50

Using the two-parameter HashTable::lookup method lets us avoid the '?' ternary, but still looks fairly ugly:

Info<< checkType << "="
<< classes.lookup(checkType, wordHashSet()).size() << nl;
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
Definition HashSet.H:80

If we have non-const access to the hash table, and don't mind incidentally creating empty entries, we can use the HashTable::operator() directly:

Info<< checkType << "=" << classes(checkType).size() << nl;

Of course, for a single query it would have been easier and simpler to have used a direct query of the names:

Info<< checkType << "=" << objects.names(checkType).size() << nl;

The summary hash, however, becomes most useful when reducing the objects in consideration to a particular subset. For example,

const wordHashSet interestingTypes
{
};
classes.retain(interestingTypes);

Or do just the opposite:

classes.erase(unsupportedTypes);

This also works with a hashedWordList, since it provides the expected '()' operator. But in this case the more general HashTable::filterKeys is required:

const hashedWordList interestingTypes
{
};
classes.filterKeys(interestingTypes);
label filterKeys(const UnaryPredicate &pred, const bool pruning=false)
Generalized means to filter table entries based on their keys.
A wordList with hashed named lookup, which can be faster in some situations than using the normal lis...

Of course, there are many other ways to use and manipulate the summary information.

Returns
HashTable of class-names for keys and wordHashSet of of object-names for the values.

Definition at line 206 of file IOobjectList.C.

Referenced by Probes< ProbeType >::prepare().

Here is the caller graph for this function:

◆ classes() [2/3]

template<class MatchPredicate>
HashTable< wordHashSet > classes ( const MatchPredicate & matchName) const

A summary hash of classes used and their associated object names, restricted to objects that have a matching object name.

◆ cobjects() [1/4]

template<class Type>
UPtrList< const IOobject > cobjects ( ) const

The unsorted list of IOobjects with headerClassName == Type::typeName.

Note
If Type is void, no headerClassName check is used (always true). The lifetime of the returned content cannot exceed the parent!

◆ cobjects() [2/4]

template<class Type, class MatchPredicate>
UPtrList< const IOobject > cobjects ( const MatchPredicate & matchName) const

The unsorted list of IOobjects with headerClassName == Type::typeName that also have a matching object name.

The lifetime of the returned content cannot exceed the parent!

◆ csorted() [1/10]

template<class Type>
UPtrList< const IOobject > csorted ( ) const

The sorted list of IOobjects with headerClassName == Type::typeName.

Note
If Type is void, no headerClassName check is used (always true). The lifetime of the returned content cannot exceed the parent!

Referenced by csorted(), csorted(), Foam::MapConsistentVolFields(), Foam::MapLagrangianFields(), Foam::MapLagrangianFields(), Foam::MapVolFields(), Foam::MapVolFields(), Foam::readFields(), Foam::readFieldsAndWriteFluent(), Foam::readUniformFields(), sorted(), sorted(), sorted(), sorted(), Foam::UnMapped(), Foam::writeAreaFields(), Foam::writeDimFields(), Foam::writePointFields(), and Foam::writeVolFields().

Here is the caller graph for this function:

◆ csorted() [2/10]

template<class Type>
UPtrList< const IOobject > csorted ( const bool syncPar) const

The sorted names of the IOobjects with optional check for parallel consistency.

FatalError if syncPar = true and names are not consistent on all processors. The lifetime of the returned content cannot exceed the parent!

◆ csorted() [3/10]

UPtrList< const IOobject > csorted ( ) const
inline

The sorted list of IOobjects.

The lifetime of the returned content cannot exceed the parent!

Definition at line 581 of file IOobjectList.H.

References csorted().

Here is the call graph for this function:

◆ csorted() [4/10]

UPtrList< const IOobject > csorted ( const bool syncPar) const
inline

The sorted list of IOobjects with optional check for parallel consistency.

FatalError if syncPar = true and names are not consistent on all processors. The lifetime of the returned content cannot exceed the parent!

Definition at line 594 of file IOobjectList.H.

References csorted().

Here is the call graph for this function:

◆ csorted() [5/10]

template<class Type, class MatchPredicate>
UPtrList< const IOobject > csorted ( const MatchPredicate & matchName) const

The sorted list of IOobjects with headerClassName == Type::typeName that also have a matching object name.

The lifetime of the returned content cannot exceed the parent!

◆ csorted() [6/10]

template<class Type, class MatchPredicate>
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 name.

FatalError if syncPar = true and names are not consistent on all processors. The lifetime of the returned content cannot exceed the parent!

◆ count() [1/9]

Foam::label count ( const char * clsName) const

The number of objects of the given headerClassName.

Note
uses the class type() method

Definition at line 212 of file IOobjectList.C.

References count().

Referenced by count(), countImpl(), countTypeImpl(), namesImpl(), namesTypeImpl(), and objectsTypeImpl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ count() [2/9]

template<class MatchPredicate>
label count ( const MatchPredicate & matchClass) const

The number of objects of the given headerClassName.

◆ count() [3/9]

template<class MatchPredicate1, class MatchPredicate2>
label count ( const MatchPredicate1 & matchClass,
const MatchPredicate2 & matchName ) const

The number of objects of the given headerClassName that also have a matching object name.

◆ count() [4/9]

template<class Type>
label count ( ) const

The number of objects with headerClassName == Type::typeName.

◆ count() [5/9]

template<class Type, class MatchPredicate>
label count ( const MatchPredicate & matchName) const

The number of objects with headerClassName == Type::typeName that also have a matching object name.

Note
If Type is void, no headerClassName check is used (always true).

◆ names() [1/20]

Foam::wordList names ( ) const

The unsorted names of the IOobjects.

Definition at line 221 of file IOobjectList.C.

References HashTable< T, Key, Hash >::toc().

Here is the call graph for this function:

◆ names() [2/20]

Foam::wordList names ( const bool syncPar) const

The sorted names of the IOobjects with optional check for parallel consistency.

FatalError if syncPar = true and names are not consistent on all processors.

Note
Output is always sorted - for consistent serial/parallel behaviour.

Definition at line 227 of file IOobjectList.C.

References sortedNames().

Here is the call graph for this function:

◆ names() [3/20]

Foam::wordList names ( const char * clsName) const

The unsorted names of IOobjects with the given headerClassName.

Definition at line 233 of file IOobjectList.C.

References names.

◆ names() [4/20]

Foam::wordList names ( const char * clsName,
const bool syncPar ) const

The sorted names of the IOobjects with the given headerClassName.

FatalError if syncPar = true and names are not consistent on all processors.

Note
Output is always sorted - for consistent serial/parallel behaviour.

Definition at line 240 of file IOobjectList.C.

References sortedNames().

Here is the call graph for this function:

◆ names() [5/20]

template<class MatchPredicate>
wordList names ( const MatchPredicate & matchClass) const

The unsorted names of IOobjects with the given headerClassName.

◆ names() [6/20]

template<class MatchPredicate>
wordList names ( const MatchPredicate & matchClass,
const bool syncPar ) const

The sorted names of the IOobjects with the given headerClassName.

FatalError if syncPar = true and names are not consistent on all processors.

Note
Output is always sorted - for consistent serial/parallel behaviour.

◆ names() [7/20]

template<class MatchPredicate1, class MatchPredicate2>
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.

◆ names() [8/20]

template<class MatchPredicate1, class MatchPredicate2>
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 name.

FatalError if syncPar = true and names are not consistent on all processors.

Note
Output is always sorted - for consistent serial/parallel behaviour.

◆ names() [9/20]

template<class Type>
wordList names ( ) const

The unsorted names of objects with headerClassName == Type::typeName.

◆ names() [10/20]

template<class Type>
wordList names ( bool syncPar) const

The sorted names of objects with headerClassName == Type::typeName.

FatalError if syncPar = true and names are not consistent on all processors.

Note
Output is always sorted - for consistent serial/parallel behaviour.

◆ names() [11/20]

template<class Type, class MatchPredicate>
wordList names ( const MatchPredicate & matchName) const

The unsorted names of objects with headerClassName == Type::typeName and a matching object name.

◆ names() [12/20]

template<class Type, class MatchPredicate>
wordList names ( const MatchPredicate & matchName,
const bool syncPar ) const

The sorted names of objects with headerClassName == Type::typeName and a matching object name.

FatalError if syncPar = true and names are not consistent on all processors.

Note
Output is always sorted - for consistent serial/parallel behaviour.

◆ sortedNames() [1/20]

Foam::wordList sortedNames ( ) const

The sorted names of the IOobjects.

Definition at line 253 of file IOobjectList.C.

References HashTable< T, Key, Hash >::sortedToc().

Referenced by names(), names(), names(), names(), names(), foamToVtkReportFields::print(), sortedNames(), sortedNames(), Foam::writeAreaFields(), Foam::writeDimFields(), Foam::writeDimFields(), Foam::writePointFields(), Foam::writeVolFields(), and Foam::writeVolFields().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sortedNames() [2/20]

Foam::wordList sortedNames ( const bool syncPar) const

The sorted names of the IOobjects with optional check for parallel consistency.

FatalError if syncPar = true and names are not consistent on all processors.

Definition at line 259 of file IOobjectList.C.

References HashTable< T, Key, Hash >::sortedToc().

Here is the call graph for this function:

◆ sortedNames() [3/20]

Foam::wordList sortedNames ( const char * clsName) const

The sorted names of IOobjects with the given headerClassName.

Definition at line 268 of file IOobjectList.C.

References sortedNames().

Here is the call graph for this function:

◆ sortedNames() [4/20]

Foam::wordList sortedNames ( const char * clsName,
const bool syncPar ) const

The sorted names of the IOobjects with the given headerClassName.

FatalError if syncPar = true and names are not consistent on all processors.

Definition at line 275 of file IOobjectList.C.

References sortedNames().

Here is the call graph for this function:

◆ sortedNames() [5/20]

template<class MatchPredicate>
wordList sortedNames ( const MatchPredicate & matchClass) const

The sorted names of IOobjects with the given headerClassName.

◆ sortedNames() [6/20]

template<class MatchPredicate>
wordList sortedNames ( const MatchPredicate & matchClass,
const bool syncPar ) const

The sorted names of the IOobjects with the given headerClassName.

FatalError if syncPar = true and names are not consistent on all processors.

◆ sortedNames() [7/20]

template<class MatchPredicate1, class MatchPredicate2>
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.

◆ sortedNames() [8/20]

template<class MatchPredicate1, class MatchPredicate2>
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 name.

FatalError if syncPar = true and names are not consistent on all processors.

◆ sortedNames() [9/20]

template<class Type>
wordList sortedNames ( ) const

The sorted names of objects with headerClassName == Type::typeName.

◆ sortedNames() [10/20]

template<class Type>
wordList sortedNames ( bool syncPar) const

The sorted names of objects with headerClassName == Type::typeName.

FatalError if syncPar = true and names are not consistent on all processors.

◆ sortedNames() [11/20]

template<class Type, class MatchPredicate>
wordList sortedNames ( const MatchPredicate & matchName) const

The sorted names of objects with headerClassName == Type::typeName that also have a matching object name.

◆ sortedNames() [12/20]

template<class Type, class MatchPredicate>
wordList sortedNames ( const MatchPredicate & matchName,
const bool syncPar ) const

The sorted names of objects with headerClassName == Type::typeName that also have a matching object name.

FatalError if syncPar = true and names are not consistent on all processors.

◆ filterClasses() [1/2]

template<class UnaryPredicate>
label filterClasses ( const UnaryPredicate & pred,
const bool pruning = false )

Filter to retain or prune given classes.

Returns
The number of items changed (removed)

◆ filterObjects() [1/2]

template<class UnaryPredicate>
label filterObjects ( const UnaryPredicate & pred,
const bool pruning = false )

Filter to retain or prune given object names.

Returns
The number of items changed (removed)

◆ prune_0()

Foam::label prune_0 ( )

Remove objects with names ending with "_0" (restart fields).

Returns
The number of items changed (removed)

Definition at line 288 of file IOobjectList.C.

References HashTable< T, Key, Hash >::filterKeys(), and k.

Here is the call graph for this function:

◆ allNames() [1/3]

Foam::wordList allNames ( ) const

The sorted names of all objects (synchronised across processors).

Definition at line 299 of file IOobjectList.C.

References HashTable< T, Key, Hash >::toc().

Here is the call graph for this function:

◆ allNames() [2/3]

template<class Type>
wordList allNames ( ) const

The sorted names of all objects (synchronised across processors) with headerClassName == Type::typeName.

◆ checkNames()

void checkNames ( const bool syncPar = true) const

Verify that object names are synchronised across processors.

FatalError if the names are not consistent on all processors.

Definition at line 308 of file IOobjectList.C.

References UPstream::is_parallel(), and HashTable< T, Key, Hash >::sortedToc().

Here is the call graph for this function:

◆ operator=() [1/2]

void operator= ( const IOobjectList & )
delete

No copy assignment.

References IOobjectList().

Here is the call graph for this function:

◆ operator=() [2/2]

void operator= ( IOobjectList && list)
inline

Move assignment.

Definition at line 134 of file IOobjectListI.H.

References IOobjectList(), and HashTable< T, Key, Hash >::transfer().

Here is the call graph for this function:

◆ lookup() [2/4]

IOobject * lookup ( const char * objName) const
inline

Deprecated(2018-11) Locate an object by name (c-string). Disambiguated from multiple-lookup version by calling parameter.

Deprecated
(2018-11) use findObject() for non-ambiguous resolution

Definition at line 1010 of file IOobjectList.H.

References getObject().

Here is the call graph for this function:

◆ lookup() [3/4]

IOobject * lookup ( const word & objName) const
inline

Deprecated(2018-11) Locate an object by name (const word&). Disambiguated from multiple-lookup version by calling parameter.

Deprecated
(2018-11) use findObject() for non-ambiguous resolution

Definition at line 1021 of file IOobjectList.H.

References getObject().

Here is the call graph for this function:

◆ sorted() [1/6]

template<class Type>
UPtrList< const IOobject > sorted ( ) const
inline

Deprecated(2023-07) use csorted() method.

Deprecated
(2023-07) - use csorted() method

Definition at line 1034 of file IOobjectList.H.

References csorted(), and sorted().

Referenced by sorted(), sorted(), sorted(), and sorted().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sorted() [2/6]

template<class Type>
UPtrList< const IOobject > sorted ( const bool syncPar) const
inline

Deprecated(2023-07) use csorted() method.

Deprecated
(2023-07) - use csorted() method

Definition at line 1046 of file IOobjectList.H.

References csorted(), and sorted().

Here is the call graph for this function:

◆ sorted() [3/6]

UPtrList< const IOobject > sorted ( ) const
inline

Deprecated(2023-07) use csorted() method.

Deprecated
(2023-07) - use csorted() method

Definition at line 1057 of file IOobjectList.H.

References csorted(), and sorted().

Here is the call graph for this function:

◆ sorted() [4/6]

UPtrList< const IOobject > sorted ( const bool syncPar) const
inline

Deprecated(2023-07) use csorted() method.

Deprecated
(2023-07) - use csorted() method

Definition at line 1068 of file IOobjectList.H.

References csorted(), and sorted().

Here is the call graph for this function:

◆ sorted() [5/6]

template<class Type, class MatchPredicate>
UPtrList< const IOobject > sorted ( const MatchPredicate & matchName) const
inline

Deprecated(2023-07) use csorted() method.

Deprecated
(2023-07) - use csorted() method

Definition at line 1080 of file IOobjectList.H.

References csorted(), and sorted().

Here is the call graph for this function:

◆ sorted() [6/6]

template<class Type, class MatchPredicate>
UPtrList< const IOobject > sorted ( const MatchPredicate & matchName,
const bool syncPar ) const
inline

Deprecated(2023-07) use csorted() method.

Deprecated
(2023-07) - use csorted() method

Definition at line 1092 of file IOobjectList.H.

References csorted(), and sorted().

Here is the call graph for this function:

◆ classesImpl()

template<class MatchPredicate>
Foam::HashTable< Foam::wordHashSet > classesImpl ( const IOobjectList & list,
const MatchPredicate & matchName )

Definition at line 28 of file IOobjectListTemplates.C.

References forAllConstIters, HashTable< T, Key, Hash >::insert(), io, IOobjectList(), and HashTable< T, Key, Hash >::reserve().

Here is the call graph for this function:

◆ countImpl()

template<class MatchPredicate1, class MatchPredicate2>
Foam::label countImpl ( const IOobjectList & list,
const MatchPredicate1 & matchClass,
const MatchPredicate2 & matchName )

Definition at line 56 of file IOobjectListTemplates.C.

References count(), forAllConstIters, io, and IOobjectList().

Here is the call graph for this function:

◆ countTypeImpl()

template<class Type, class MatchPredicate>
Foam::label countTypeImpl ( const IOobjectList & list,
const MatchPredicate & matchName )

Definition at line 81 of file IOobjectListTemplates.C.

References count(), forAllConstIters, io, and IOobjectList().

Here is the call graph for this function:

◆ namesImpl()

template<class MatchPredicate1, class MatchPredicate2>
Foam::wordList namesImpl ( const IOobjectList & list,
const MatchPredicate1 & matchClass,
const MatchPredicate2 & matchName,
const bool doSort )

Definition at line 105 of file IOobjectListTemplates.C.

References count(), forAllConstIters, io, IOobjectList(), List< T >::resize(), HashTable< T, Key, Hash >::size(), and Foam::sort().

Here is the call graph for this function:

◆ namesTypeImpl()

template<class Type, class MatchPredicate>
Foam::wordList namesTypeImpl ( const IOobjectList & list,
const MatchPredicate & matchName,
const bool doSort )

Definition at line 141 of file IOobjectListTemplates.C.

References count(), forAllConstIters, io, IOobjectList(), List< T >::resize(), HashTable< T, Key, Hash >::size(), and Foam::sort().

Here is the call graph for this function:

◆ objectsTypeImpl()

template<class Type, class MatchPredicate>
Foam::UPtrList< const Foam::IOobject > objectsTypeImpl ( const IOobjectList & list,
const MatchPredicate & matchName,
const bool doSort )

Definition at line 177 of file IOobjectListTemplates.C.

References count(), forAllConstIters, io, IOobjectList(), UPtrList< T >::resize(), UPtrList< T >::set(), HashTable< T, Key, Hash >::size(), and Foam::sort().

Here is the call graph for this function:

◆ lookupImpl()

template<class MatchPredicate>
Foam::IOobjectList lookupImpl ( const IOobjectList & list,
const MatchPredicate & matchName )

Definition at line 212 of file IOobjectListTemplates.C.

References Foam::endl(), forAllConstIters, InfoInFunction, io, IOobjectList(), HashPtrTable< T, Key, Hash >::set(), and HashTable< T, Key, Hash >::size().

Here is the call graph for this function:

◆ lookupClassImpl()

template<class MatchPredicate1, class MatchPredicate2>
Foam::IOobjectList lookupClassImpl ( const IOobjectList & list,
const MatchPredicate1 & matchClass,
const MatchPredicate2 & matchName )

Definition at line 242 of file IOobjectListTemplates.C.

References Foam::endl(), forAllConstIters, InfoInFunction, io, IOobjectList(), HashPtrTable< T, Key, Hash >::set(), and HashTable< T, Key, Hash >::size().

Here is the call graph for this function:

◆ lookupClassTypeImpl()

template<class Type, class MatchPredicate>
Foam::IOobjectList lookupClassTypeImpl ( const IOobjectList & list,
const MatchPredicate & matchName )

Definition at line 273 of file IOobjectListTemplates.C.

References Foam::endl(), forAllConstIters, InfoInFunction, io, IOobjectList(), HashPtrTable< T, Key, Hash >::set(), and HashTable< T, Key, Hash >::size().

Here is the call graph for this function:

◆ cfindObject() [3/3]

template<class Type>
const Foam::IOobject * cfindObject ( const word & objName) const

Definition at line 304 of file IOobjectListTemplates.C.

References HashTable< T, Key, Hash >::cfind(), Foam::endl(), InfoInFunction, and io.

Here is the call graph for this function:

◆ findObject() [5/6]

template<class Type>
const Foam::IOobject * findObject ( const word & objName) const

Definition at line 351 of file IOobjectListTemplates.C.

References cfindObject().

Here is the call graph for this function:

◆ findObject() [6/6]

template<class Type>
Foam::IOobject * findObject ( const word & objName)

Definition at line 361 of file IOobjectListTemplates.C.

References cfindObject().

Here is the call graph for this function:

◆ getObject() [3/3]

template<class Type>
Foam::IOobject * getObject ( const word & objName) const

Definition at line 368 of file IOobjectListTemplates.C.

References cfindObject().

Here is the call graph for this function:

◆ lookup() [4/4]

template<class MatchPredicate>
Foam::IOobjectList lookup ( const MatchPredicate & matchName) const

Definition at line 375 of file IOobjectListTemplates.C.

◆ lookupClass() [6/9]

template<class MatchPredicate>
Foam::IOobjectList lookupClass ( const MatchPredicate & matchClass) const

Definition at line 385 of file IOobjectListTemplates.C.

◆ lookupClass() [7/9]

template<class MatchPredicate1, class MatchPredicate2>
Foam::IOobjectList lookupClass ( const MatchPredicate1 & matchClass,
const MatchPredicate2 & matchName ) const

Definition at line 395 of file IOobjectListTemplates.C.

◆ lookupClass() [8/9]

template<class Type>
Foam::IOobjectList lookupClass ( ) const

Definition at line 406 of file IOobjectListTemplates.C.

◆ lookupClass() [9/9]

template<class Type, class MatchPredicate>
Foam::IOobjectList lookupClass ( const MatchPredicate & matchName) const

Definition at line 413 of file IOobjectListTemplates.C.

◆ classes() [3/3]

template<class MatchPredicate>
Foam::HashTable< Foam::wordHashSet > classes ( const MatchPredicate & matchName) const

Definition at line 424 of file IOobjectListTemplates.C.

◆ count() [6/9]

template<class MatchPredicate>
Foam::label count ( const MatchPredicate & matchClass) const

Definition at line 434 of file IOobjectListTemplates.C.

◆ count() [7/9]

template<class MatchPredicate1, class MatchPredicate2>
Foam::label count ( const MatchPredicate1 & matchClass,
const MatchPredicate2 & matchName ) const

Definition at line 444 of file IOobjectListTemplates.C.

◆ count() [8/9]

template<class Type>
Foam::label count ( ) const

Definition at line 455 of file IOobjectListTemplates.C.

◆ count() [9/9]

template<class Type, class MatchPredicate>
Foam::label count ( const MatchPredicate & matchName) const

Definition at line 462 of file IOobjectListTemplates.C.

◆ cobjects() [3/4]

template<class Type>
Foam::UPtrList< const Foam::IOobject > cobjects ( ) const

Definition at line 476 of file IOobjectListTemplates.C.

◆ csorted() [7/10]

template<class Type>
Foam::UPtrList< const Foam::IOobject > csorted ( ) const

Definition at line 485 of file IOobjectListTemplates.C.

◆ csorted() [8/10]

template<class Type>
Foam::UPtrList< const Foam::IOobject > csorted ( const bool syncPar) const

Definition at line 494 of file IOobjectListTemplates.C.

◆ cobjects() [4/4]

template<class Type, class MatchPredicate>
Foam::UPtrList< const Foam::IOobject > cobjects ( const MatchPredicate & matchName) const

Definition at line 510 of file IOobjectListTemplates.C.

◆ csorted() [9/10]

template<class Type, class MatchPredicate>
Foam::UPtrList< const Foam::IOobject > csorted ( const MatchPredicate & matchName) const

Definition at line 522 of file IOobjectListTemplates.C.

◆ csorted() [10/10]

template<class Type, class MatchPredicate>
Foam::UPtrList< const Foam::IOobject > csorted ( const MatchPredicate & matchName,
const bool syncPar ) const

Definition at line 534 of file IOobjectListTemplates.C.

◆ names() [13/20]

template<class MatchPredicate>
Foam::wordList names ( const MatchPredicate & matchClass) const

Definition at line 555 of file IOobjectListTemplates.C.

◆ names() [14/20]

template<class MatchPredicate>
Foam::wordList names ( const MatchPredicate & matchClass,
const bool syncPar ) const

Definition at line 566 of file IOobjectListTemplates.C.

References sortedNames().

Here is the call graph for this function:

◆ names() [15/20]

template<class MatchPredicate1, class MatchPredicate2>
Foam::wordList names ( const MatchPredicate1 & matchClass,
const MatchPredicate2 & matchName ) const

Definition at line 577 of file IOobjectListTemplates.C.

◆ names() [16/20]

template<class MatchPredicate1, class MatchPredicate2>
Foam::wordList names ( const MatchPredicate1 & matchClass,
const MatchPredicate2 & matchName,
const bool syncPar ) const

Definition at line 589 of file IOobjectListTemplates.C.

References sortedNames().

Here is the call graph for this function:

◆ names() [17/20]

template<class Type>
Foam::wordList names ( ) const

Definition at line 601 of file IOobjectListTemplates.C.

◆ names() [18/20]

template<class Type>
Foam::wordList names ( const bool syncPar) const

Definition at line 609 of file IOobjectListTemplates.C.

References sortedNames().

Here is the call graph for this function:

◆ names() [19/20]

template<class Type, class MatchPredicate>
Foam::wordList names ( const MatchPredicate & matchName) const

Definition at line 616 of file IOobjectListTemplates.C.

◆ names() [20/20]

template<class Type, class MatchPredicate>
Foam::wordList names ( const MatchPredicate & matchName,
const bool syncPar ) const

Definition at line 627 of file IOobjectListTemplates.C.

References sortedNames().

Here is the call graph for this function:

◆ sortedNames() [13/20]

template<class MatchPredicate>
Foam::wordList sortedNames ( const MatchPredicate & matchClass) const

Definition at line 640 of file IOobjectListTemplates.C.

◆ sortedNames() [14/20]

template<class MatchPredicate>
Foam::wordList sortedNames ( const MatchPredicate & matchClass,
const bool syncPar ) const

Definition at line 650 of file IOobjectListTemplates.C.

◆ sortedNames() [15/20]

template<class MatchPredicate1, class MatchPredicate2>
Foam::wordList sortedNames ( const MatchPredicate1 & matchClass,
const MatchPredicate2 & matchName ) const

Definition at line 667 of file IOobjectListTemplates.C.

◆ sortedNames() [16/20]

template<class MatchPredicate1, class MatchPredicate2>
Foam::wordList sortedNames ( const MatchPredicate1 & matchClass,
const MatchPredicate2 & matchName,
const bool syncPar ) const

Definition at line 678 of file IOobjectListTemplates.C.

◆ sortedNames() [17/20]

template<class Type>
Foam::wordList sortedNames ( ) const

Definition at line 693 of file IOobjectListTemplates.C.

◆ sortedNames() [18/20]

template<class Type>
Foam::wordList sortedNames ( const bool syncPar) const

Definition at line 700 of file IOobjectListTemplates.C.

◆ sortedNames() [19/20]

template<class Type, class MatchPredicate>
Foam::wordList sortedNames ( const MatchPredicate & matchName) const

Definition at line 710 of file IOobjectListTemplates.C.

◆ sortedNames() [20/20]

template<class Type, class MatchPredicate>
Foam::wordList sortedNames ( const MatchPredicate & matchName,
const bool syncPar ) const

Definition at line 720 of file IOobjectListTemplates.C.

◆ filterClasses() [2/2]

template<class UnaryPredicate>
Foam::label filterClasses ( const UnaryPredicate & pred,
const bool pruning )

Definition at line 736 of file IOobjectListTemplates.C.

References HashTable< T, Key, Hash >::begin(), HashTable< T, Key, Hash >::end(), and HashPtrTable< IOobject >::erase().

Here is the call graph for this function:

◆ filterObjects() [2/2]

template<class UnaryPredicate>
Foam::label filterObjects ( const UnaryPredicate & pred,
const bool pruning )

Definition at line 773 of file IOobjectListTemplates.C.

References HashTable< T, Key, Hash >::begin(), HashTable< T, Key, Hash >::end(), and HashPtrTable< IOobject >::erase().

Here is the call graph for this function:

◆ allNames() [3/3]

template<class Type>
Foam::wordList allNames ( ) const

Definition at line 806 of file IOobjectListTemplates.C.


The documentation for this class was generated from the following files: