mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: support HashTable erasure via a FixedList
- propagate common erasure methods as HashSet::unset() method, for symmetry with HashSet::set()
This commit is contained in:
@ -60,6 +60,7 @@ namespace Foam
|
||||
|
||||
template<class T> class List;
|
||||
template<class T> class UList;
|
||||
template<class T, unsigned Size> class FixedList;
|
||||
template<class T, class Key, class Hash> class HashTable;
|
||||
template<class T, class Key, class Hash> class HashPtrTable;
|
||||
|
||||
@ -174,6 +175,18 @@ class HashTable
|
||||
bool set(const Key& key, const T& newEntry, const bool protect);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Remove using begin/end iterators of listed keys
|
||||
template<class InputIter>
|
||||
inline label eraseMultiple
|
||||
(
|
||||
const InputIter begIter,
|
||||
const InputIter endIter
|
||||
);
|
||||
|
||||
public:
|
||||
|
||||
// Forward declaration of iterators
|
||||
@ -274,6 +287,15 @@ public:
|
||||
// Return the number of elements removed
|
||||
label erase(const UList<Key>& keys);
|
||||
|
||||
//- Remove entries given by the listed keys from this HashTable
|
||||
// Return the number of elements removed
|
||||
template<unsigned Size>
|
||||
label erase(const FixedList<Key, Size>& keys);
|
||||
|
||||
//- Remove entries given by the listed keys from this HashTable
|
||||
// Return the number of elements removed
|
||||
label erase(std::initializer_list<Key> keys);
|
||||
|
||||
//- Remove entries given by the given keys from this HashTable
|
||||
// Return the number of elements removed.
|
||||
// The parameter HashTable needs the same type of key, but the
|
||||
|
||||
Reference in New Issue
Block a user