ENH: define IOobjectList::csorted(), deprecate some sorted() const methods

- prefer csorted() method for const access since it ensures that the
  return values are also const pointers (for example) even if
  the object itself can be accessed as a non-const.

- the csorted() method already existed for HashTable and
  objectRegistry, but now added to IOobjectList for method name
  consistency (even although the IOobjectList only has a const-access
  version)

ENH: objectRegistry with templated strict lookup

- for lookupClass and csorted/sorted. Allows isType restriction as a
  compile-time specification.
This commit is contained in:
Mark Olesen
2023-07-07 12:25:34 +02:00
parent 0eb4354ee0
commit 129b738136
18 changed files with 418 additions and 220 deletions

View File

@ -192,14 +192,6 @@ Foam::HashTable<T, Key, Hash>::csorted() const
}
template<class T, class Key, class Hash>
Foam::UPtrList<const typename Foam::HashTable<T, Key, Hash>::node_type>
Foam::HashTable<T, Key, Hash>::sorted() const
{
return csorted();
}
template<class T, class Key, class Hash>
Foam::UPtrList<typename Foam::HashTable<T, Key, Hash>::node_type>
Foam::HashTable<T, Key, Hash>::sorted()