ENH: improve hashing overloads of string-types and HashTable/HashSet
- additional dummy template parameter to assist with supporting derived classes. Currently just used for string types, but can be extended. - provide hash specialization for various integer types. Removes the need for any forwarding. - change default hasher for HashSet/HashTable from 'string::hash' to `Hash<Key>`. This avoids questionable hashing calls and/or avoids compiler resolution problems. For example, HashSet<label>::hasher and labelHashSet::hasher now both properly map to Hash<label> whereas previously HashSet<label> would have persistently mapped to string::hash, which was incorrect. - standardize internal hashing functors. Functor name is 'hasher', as per STL set/map and the OpenFOAM HashSet/HashTable definitions. Older code had a local templated name, which added unnecessary clutter and the template parameter was always defaulted. For example, Old: `FixedList<label, 3>::Hash<>()` New: `FixedList<label, 3>::hasher()` Unchanged: `labelHashSet::hasher()` Existing `Hash<>` functor namings are still supported, but deprecated. - define hasher and Hash specialization for bitSet and PackedList - add symmetric hasher for 'face'. Starts with lowest vertex value and walks in the direction of the next lowest value. This ensures that the hash code is independent of face orientation and face rotation. NB: - some of keys for multiphase handling (eg, phasePairKey) still use yet another function naming: `hash` and `symmHash`. This will be targeted for alignment in the future.
Showing
- applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.H 11 additions, 16 deletions...terFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.H
- applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H 9 additions, 13 deletions...multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H
- applications/test/FixedList/Test-FixedList.C 2 additions, 2 deletionsapplications/test/FixedList/Test-FixedList.C
- applications/test/HashPtrTable/Test-HashPtrTable.C 3 additions, 3 deletionsapplications/test/HashPtrTable/Test-HashPtrTable.C
- applications/test/HashSet/Test-hashSet.C 6 additions, 1 deletionapplications/test/HashSet/Test-hashSet.C
- applications/test/Hashing/Make/files 0 additions, 3 deletionsapplications/test/Hashing/Make/files
- applications/test/Hashing1/HashFunction.H 224 additions, 0 deletionsapplications/test/Hashing1/HashFunction.H
- applications/test/Hashing1/Make/files 3 additions, 0 deletionsapplications/test/Hashing1/Make/files
- applications/test/Hashing1/Make/options 0 additions, 0 deletionsapplications/test/Hashing1/Make/options
- applications/test/Hashing1/Test-Hashing1.C 163 additions, 0 deletionsapplications/test/Hashing1/Test-Hashing1.C
- applications/test/Hashing2/Make/files 3 additions, 0 deletionsapplications/test/Hashing2/Make/files
- applications/test/Hashing2/Make/options 3 additions, 0 deletionsapplications/test/Hashing2/Make/options
- applications/test/Hashing2/Test-Hashing2.C 15 additions, 18 deletionsapplications/test/Hashing2/Test-Hashing2.C
- applications/test/Hashing2/hashingTests 0 additions, 0 deletionsapplications/test/Hashing2/hashingTests
- applications/test/HashingSpeed/Test-HashingSpeed.C 3 additions, 3 deletionsapplications/test/HashingSpeed/Test-HashingSpeed.C
- applications/test/List/Test-List.C 3 additions, 3 deletionsapplications/test/List/Test-List.C
- applications/test/ListOps2/Test-ListOps2.C 4 additions, 4 deletionsapplications/test/ListOps2/Test-ListOps2.C
- applications/test/faceHashing/Make/files 3 additions, 0 deletionsapplications/test/faceHashing/Make/files
- applications/test/faceHashing/Make/options 3 additions, 0 deletionsapplications/test/faceHashing/Make/options
- applications/test/faceHashing/Test-faceHashing.C 153 additions, 0 deletionsapplications/test/faceHashing/Test-faceHashing.C