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
169 HashSet(std::initializer_list<Key> list);
173 template<
class AnyType,
class AnyHash>
181 bool test(
const Key& key)
const noexcept
192 bool insert(
const Key& key)
198 bool set(
const Key& key)
205 bool unset(
const Key& key)
215 template<
class InputIter>
216 inline label
insert(InputIter first, InputIter last);
220 inline label
insert(std::initializer_list<Key> list);
237 template<
class InputIter>
238 inline label
set(InputIter first, InputIter last)
240 return insert(first, last);
244 inline label
set(std::initializer_list<Key> list)
271 template<
class InputIter>
272 inline label
setMany(InputIter first, InputIter last)
274 return insert(first, last);
279 template<
class InputIter>
280 inline label
unset(InputIter first, InputIter last);
284 inline label
unset(std::initializer_list<Key> list);
327 inline bool operator()(
const Key& key)
const noexcept;
330 inline bool operator[](
const Key& key)
const noexcept;
365 void operator=(std::initializer_list<Key> rhs);
389 template<
class UnaryPredicate>
393 template<
class BinaryPredicate>
397 template<
class UnaryPredicate>
398 label
countValues(
const UnaryPredicate&,
const bool) =
delete;
401 template<
class BinaryPredicate>
402 label
countEntries(
const BinaryPredicate&,
const bool) =
delete;
405 template<
class UnaryPredicate>
406 label
filterValues(
const UnaryPredicate&,
const bool) =
delete;
409 template<
class BinaryPredicate>
410 label
filterEntries(
const BinaryPredicate&,
const bool) =
delete;
433template<
class Key,
class Hash>
439template<
class Key,
class Hash>
448template<
class Key,
class Hash>
457template<
class Key,
class Hash>
466template<
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.
HashTable< zero::null, Key, Hash > parent_type
The template instance used for the parent HashTable.
bool operator[](const Key &key) const noexcept
Return true if the entry exists, same as found().
Ostream & writeList(Ostream &os, const label shortLen=0) const
bool operator()(const Key &key) const noexcept
Return true if the entry exists, same as found()
label set(std::initializer_list< Key > list)
Same as insert (no value to overwrite)
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)
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.
HashSet(Istream &is)
Construct from Istream with default table capacity.
List< Key > tocValues(const UnaryPredicate &, const bool)=delete
Not applicable for HashSet.
label insert(InputIter first, InputIter last)
Insert keys from the input iterator range.
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
An iterator, returning reference to the key.
void operator=(this_type &&rhs)
Move assign.
bool operator==(const this_type &rhs) const
typename parent_type::const_key_iterator const_iterator
A const_iterator, returning reference to the key.
bool unset(const Key &key)
Unset the specified key - same as erase.
const_iterator cbegin() const
HashSet(const label size)
Construct given initial table capacity.
HashSet< Key, Hash > this_type
The template instance used for this HashSet.
constexpr const_iterator cend() const noexcept
label filterEntries(const BinaryPredicate &, const bool)=delete
Not applicable for HashSet.
label insert(const IndirectListBase< Key, Addr > &list)
Insert keys from the list of Key.
HashSet()
Default construct with default (128) table capacity.
label unset(const IndirectListBase< Key, Addr > &list)
Unset the listed keys - same as erase.
bool test(const Key &key) const noexcept
Same as found() - return true if key exists in the set.
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)
this_type & operator&=(const this_type &rhs)
Only retain entries found in both HashSets.
HashSet(const this_type &rhs)
Copy construct.
label countValues(const UnaryPredicate &, const bool)=delete
Not applicable for HashSet.
HashSet(this_type &&rhs)
Move construct.
this_type & operator^=(const this_type &rhs)
Only retain unique entries (xor)
bool set(const Key &key)
Same as insert (no value to overwrite)
void operator=(const this_type &rhs)
Copy assign.
label setMany(InputIter first, InputIter last)
Same as insert (no value to overwrite)
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.
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.
this_type & operator+=(const this_type &rhs)
Add entries to this HashSet. Same as the '|=' operator.
A HashTable similar to std::unordered_map.
Ostream & writeKeys(Ostream &os, const label shortLen=0) const
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.
label size() const noexcept
The number of elements in table.
bool erase(const iterator &iter)
Erase an entry specified by given iterator.
void operator=(const this_type &rhs)
Copy assign.
bool emplace(const Key &key, Args &&... args)
Emplace insert a new entry, not overwriting existing entries.
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...
OBJstream os(runTime.globalPath()/outputName)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
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.
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.