Go to the documentation of this file.
78 template<
class Key,
class Hash>
class HashSet;
93 template<
class Key,
class Hash=Foam::Hash<Key>>
101 template<
class InputIter>
102 inline label assignMany
146 explicit HashSet(
const label size)
169 HashSet(std::initializer_list<Key> list);
173 template<
class AnyType,
class AnyHash>
181 bool test(
const Key&
key)
const noexcept
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);
319 return this->writeKeys(
os, shortLen);
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;
433 template<
class Key,
class Hash>
434 Ostream&
operator<<(Ostream&
os,
const HashSet<Key, Hash>& rhs);
439 template<
class Key,
class Hash>
440 HashSet<Key, Hash>
operator|
442 const HashSet<Key, Hash>& a,
443 const HashSet<Key, Hash>&
b
448 template<
class Key,
class Hash>
449 HashSet<Key, Hash>
operator&
451 const HashSet<Key, Hash>& a,
452 const HashSet<Key, Hash>&
b
457 template<
class Key,
class Hash>
458 HashSet<Key, Hash>
operator^
460 const HashSet<Key, Hash>& a,
461 const HashSet<Key, Hash>&
b
466 template<
class Key,
class Hash>
467 HashSet<Key, Hash>
operator-
469 const HashSet<Key, Hash>& a,
470 const HashSet<Key, Hash>&
b
label set(const IndirectListBase< Key, Addr > &list)
Same as insert (no value to overwrite)
void operator=(this_type &&rhs)
Move assign.
HashSet()
Default construct with default (128) table capacity.
HashTable< zero::null, Key, Hash > parent_type
The template instance used for the parent HashTable.
void set(List< bool > &bools, const labelRange &range)
Set the specified range 'on' in a boolList.
Ostream & writeList(Ostream &os, const label shortLen=0) const
label set(const UList< Key > &list)
Same as insert (no value to overwrite)
bool operator[](const Key &key) const noexcept
Return true if the entry exists, same as found().
void operator=(const this_type &rhs)
Copy assign.
key_iterator_base< iterator > key_iterator
Forward iterator returning the key.
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
bool emplace(const Key &key, Args &&... args)
Emplace insert a new entry, not overwriting existing entries.
bool test(const Key &key) const noexcept
Same as found() - return true if key exists in the set.
List< Key > tocValues(const UnaryPredicate &, const bool)=delete
Not applicable for HashSet.
label set(const FixedList< Key, N > &list)
Same as insert (no value to overwrite)
bool operator==(const this_type &rhs) const
A HashTable with keys but without contents that is similar to std::unordered_set.
void operator=(const this_type &rhs)
Copy assign.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
label setMany(InputIter first, InputIter last)
Same as insert (no value to overwrite)
this_type & operator+=(const this_type &rhs)
Add entries to this HashSet. Same as the '|=' operator.
this_type & operator|=(const this_type &rhs)
Add entries to this HashSet.
typename parent_type::const_key_iterator const_iterator
A const_iterator, returning reference to the key.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
bool operator!=(const this_type &rhs) const
The opposite of the equality operation.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
label filterValues(const UnaryPredicate &, const bool)=delete
Not applicable for HashSet.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
bool erase(const iterator &iter)
Erase an entry specified by given iterator.
key_iterator_base< const_iterator > const_key_iterator
Forward const iterator returning the key.
label countEntries(const BinaryPredicate &, const bool)=delete
Not applicable for HashSet.
HashSet< Key, Hash > this_type
The template instance used for this HashSet.
this_type & operator&=(const this_type &rhs)
Only retain entries found in both HashSets.
label set(InputIter first, InputIter last)
Same as insert (no value to overwrite)
List< Key > tocEntries(const BinaryPredicate &, const bool)=delete
Not applicable for HashSet.
HashSet(this_type &&rhs)
Move construct.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
bool unset(const Key &key)
Unset the specified key - same as erase.
label countValues(const UnaryPredicate &, const bool)=delete
Not applicable for HashSet.
HashSet(const this_type &rhs)
Copy construct.
HashSet(const label size)
Construct given initial table capacity.
constexpr const_iterator cend() const noexcept
this_type & operator-=(const this_type &rhs)
Remove entries from this HashSet. Uses erase()
OBJstream os(runTime.globalPath()/outputName)
label set(std::initializer_list< Key > list)
Same as insert (no value to overwrite)
bool operator()(const Key &key) const noexcept
Return true if the entry exists, same as found()
HashSet(Istream &is)
Construct from Istream with default table capacity.
label filterEntries(const BinaryPredicate &, const bool)=delete
Not applicable for HashSet.
A HashTable similar to std::unordered_map.
this_type & operator^=(const this_type &rhs)
Only retain unique entries (xor)
const_iterator cbegin() const
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A 1D vector of objects of type <T> with a fixed length <N>.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
typename parent_type::key_iterator iterator
An iterator, returning reference to the key.
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
Base for lists with indirect addressing, templated on the list contents type and the addressing type....
MinMax< label > minMax(const labelHashSet &set)
Find the min/max values of labelHashSet.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
A min/max value pair with additional methods. In addition to conveniently storing values,...
bool set(const Key &key)
Same as insert (no value to overwrite)