77template<
class T>
class MinMax;
78template<
class Key,
class Hash>
class HashSet;
93template<
class Key,
class Hash=Foam::Hash<Key>>
101 template<
class InputIter>
102 inline label assignMany
134 explicit HashSet(
const label initialCapacity)
169 HashSet(std::initializer_list<Key> list);
173 template<
class AnyType,
class AnyHash>
181 bool test(
const Key& key)
const
192 bool insert(
const Key& key)
225 template<
class InputIter>
226 inline label
insert(InputIter first, InputIter last);
230 inline label
insert(std::initializer_list<Key> list);
247 template<
class InputIter>
248 inline label
set(InputIter first, InputIter last)
250 return insert(first, last);
254 inline label
set(std::initializer_list<Key> list)
274 inline label
set(
const IndirectListBase<Key, Addr>& list)
281 template<
class InputIter>
282 inline label
setMany(InputIter first, InputIter last)
284 return insert(first, last);
289 template<
class InputIter>
290 inline label
unset(InputIter first, InputIter last);
294 inline label
unset(std::initializer_list<Key> list);
337 inline bool operator()(
const Key& key)
const noexcept;
340 inline bool operator[](
const Key& key)
const noexcept;
399 template<
class UnaryPredicate>
403 template<
class BinaryPredicate>
407 template<
class UnaryPredicate>
411 template<
class BinaryPredicate>
412 label
countEntries(
const BinaryPredicate&,
const bool) =
delete;
415 template<
class UnaryPredicate>
416 label
filterValues(
const UnaryPredicate&,
const bool) =
delete;
419 template<
class BinaryPredicate>
420 label
filterEntries(
const BinaryPredicate&,
const bool) =
delete;
443template<
class Key,
class Hash>
449template<
class Key,
class Hash>
458template<
class Key,
class Hash>
467template<
class Key,
class Hash>
476template<
class Key,
class Hash>
A 1D vector of objects of type <T> with a fixed length <N>.
A HashTable with keys but without contents that is similar to std::unordered_set.
bool operator[](const Key &key) const noexcept
Return true if the entry exists, same as contains().
Ostream & writeList(Ostream &os, const label shortLen=0) const
bool operator()(const Key &key) const noexcept
Return true if the entry exists, same as contains().
HashSet(const label initialCapacity)
Construct empty with initial table capacity.
label set(std::initializer_list< Key > list)
Same as insert (no value to overwrite).
void operator=(std::initializer_list< Key > rhs)
Assignment from an initializer list of keys.
void merge(HashSet< Key, Hash > &&source)
Attempts to extract entries from source parameter and insert them into this, does not overwrite exist...
label set(const UList< Key > &list)
Same as insert (no value to overwrite).
label set(InputIter first, InputIter last)
Same as insert (no value to overwrite).
label unset(std::initializer_list< Key > list)
Unset the listed keys - same as erase.
label unset(const UList< Key > &list)
Unset the listed keys - same as erase.
HashSet(this_type &&rhs) noexcept
Move construct.
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
label countEntries(const BinaryPredicate &, const bool)=delete
Not applicable for HashSet.
this_type & operator|=(const this_type &rhs)
Add entries to this HashSet.
const_iterator begin() const
HashSet(Istream &is)
Construct from Istream with default initial table capacity.
List< Key > tocValues(const UnaryPredicate &, const bool)=delete
Not applicable for HashSet.
constexpr HashSet() noexcept=default
Default construct: empty without allocation (capacity=0).
label insert(InputIter first, InputIter last)
Insert keys from the input iterator range.
HashSet(const IndirectListBase< Key, Addr > &list)
Construct from an indirect list.
label set(const FixedList< Key, N > &list)
Same as insert (no value to overwrite).
label unset(InputIter first, InputIter last)
Unset the keys listed in the input iterator range.
typename parent_type::key_iterator iterator
void operator=(this_type &&rhs)
Move assign.
bool operator==(const this_type &rhs) const
Sets are equal if all keys are equal, independent of order or underlying storage size.
typename parent_type::const_key_iterator const_iterator
void operator=(const FixedList< Key, N > &rhs)
Assignment from a FixedList of keys.
bool unset(const Key &key)
Unset the specified key - same as erase.
label insert(std::initializer_list< Key > list)
Insert keys from a initializer list of Key.
label insert(const UList< Key > &list)
Insert keys from the list of Key.
const_iterator cbegin() const
HashSet< Key, HashType > this_type
constexpr const_iterator cend() const noexcept
label filterEntries(const BinaryPredicate &, const bool)=delete
Not applicable for HashSet.
HashSet(const FixedList< Key, N > &list)
Construct from FixedList of Key.
label insert(const IndirectListBase< Key, Addr > &list)
Insert keys from the list of Key.
label unset(const IndirectListBase< Key, Addr > &list)
Unset the listed keys - same as erase.
this_type & operator-=(const this_type &rhs)
Remove entries from this HashSet. Uses erase().
label insert(const FixedList< Key, N > &list)
Insert keys from the list of Key.
label set(const IndirectListBase< Key, Addr > &list)
Same as insert (no value to overwrite).
void operator=(const UList< Key > &rhs)
Assignment from a UList of keys.
this_type & operator&=(const this_type &rhs)
Only retain entries contained in both HashSets.
HashSet(const this_type &rhs)
Copy construct.
bool test(const Key &key) const
Same as contains() - return true if key exists in the set.
label countValues(const UnaryPredicate &, const bool)=delete
Not applicable for HashSet.
this_type & operator^=(const this_type &rhs)
Only retain unique entries (xor).
bool set(const Key &key)
Same as insert (no value to overwrite).
HashSet(const UList< Key > &list)
Construct from UList of Key.
void operator=(const this_type &rhs)
Copy assign.
HashSet(std::initializer_list< Key > list)
Construct from an initializer list of Key.
label setMany(InputIter first, InputIter last)
Same as insert (no value to overwrite).
void merge(HashSet< Key, Hash > &source)
Attempts to extract entries from source parameter and insert them into this, does not overwrite exist...
List< Key > tocEntries(const BinaryPredicate &, const bool)=delete
Not applicable for HashSet.
bool operator!=(const this_type &rhs) const
The opposite of the equality operation.
HashSet(const HashTable< AnyType, Key, AnyHash > &tbl)
Construct from the keys of another HashTable, the type of values held is arbitrary.
label unset(const FixedList< Key, N > &list)
Unset the listed keys - same as erase.
label filterValues(const UnaryPredicate &, const bool)=delete
Not applicable for HashSet.
HashTable< Foam::zero, Key, HashType > parent_type
this_type & operator+=(const this_type &rhs)
Add entries to this HashSet. Same as the '|=' operator.
Ostream & writeKeys(Ostream &os, const label shortLen=0) const
Write unordered keys (list), with line-breaks when length exceeds shortLen.
bool contains(const Key &key) const
True if hashed key is contained (found) in table.
key_iterator_base< iterator > key_iterator
Forward iterator returning the key.
key_iterator_base< const_iterator > const_key_iterator
Forward const iterator returning the key.
bool erase(const iterator &iter)
void operator=(const this_type &rhs)
bool emplace(const Key &key, Args &&... args)
constexpr HashTable() noexcept
Default construct: empty without allocation (capacity=0).
Base for lists with indirect addressing, templated on the list contents type and the addressing type....
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A min/max value pair with additional methods. In addition to conveniently storing values,...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
OBJstream os(runTime.globalPath()/outputName)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
MinMax< label > minMax(const labelHashSet &set)
Find the min/max values of labelHashSet.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)
nonInt insert("surfaceSum(((S|magSf)*S)")