37 template<
class Key,
class Hash>
38 template<
class InputIter>
49 return insert(first, last);
55 template<
class Key,
class Hash>
65 template<
class Key,
class Hash>
68 parent_type(2*list.size())
74 template<
class Key,
class Hash>
84 template<
class Key,
class Hash>
87 parent_type(2*list.size())
93 template<
class Key,
class Hash>
94 template<
class AnyType,
class AnyHash>
100 parent_type(2*tbl.size())
102 for (
auto iter = tbl.
cbegin(); iter != tbl.
cend(); ++iter)
111 template<
class Key,
class Hash>
112 template<
class InputIter>
120 while (first != last)
132 template<
class Key,
class Hash>
135 std::initializer_list<Key> list
142 template<
class Key,
class Hash>
153 template<
class Key,
class Hash>
163 template<
class Key,
class Hash>
174 template<
class Key,
class Hash>
175 template<
class InputIter>
186 template<
class Key,
class Hash>
189 std::initializer_list<Key> list
192 return unset(list.begin(), list.end());
196 template<
class Key,
class Hash>
207 template<
class Key,
class Hash>
217 template<
class Key,
class Hash>
228 template<
class Key,
class Hash>
231 parent_type::merge(source);
235 template<
class Key,
class Hash>
238 parent_type::merge(source);
244 template<
class Key,
class Hash>
247 return this->contains(
key);
251 template<
class Key,
class Hash>
254 return this->contains(
key);
258 template<
class Key,
class Hash>
266 template<
class Key,
class Hash>
273 template<
class Key,
class Hash>
276 assignMany(rhs.size(), rhs.begin(), rhs.end());
280 template<
class Key,
class Hash>
288 else if (this->size() != rhs.
size())
293 for (const_iterator iter = rhs.
cbegin(); iter != rhs.
cend(); ++iter)
295 if (!this->contains(iter.key()))
305 template<
class Key,
class Hash>
312 template<
class Key,
class Hash>
319 for (const_iterator iter = rhs.
cbegin(); iter != rhs.
cend(); ++iter)
329 template<
class Key,
class Hash>
333 this->parent_type::retain(rhs);
338 template<
class Key,
class Hash>
343 for (const_iterator iter = rhs.
cbegin(); iter != rhs.
cend(); ++iter)
345 if (this->contains(iter.key()))
347 this->
erase(iter.key());
359 template<
class Key,
class Hash>
363 return this->operator|=(rhs);
367 template<
class Key,
class Hash>
379 template<
class Key,
class Hash>
380 Foam::Ostream& Foam::operator<<(Ostream& os, const HashSet<Key, Hash>& rhs)
382 return rhs.
writeKeys(
os, Detail::ListPolicy::short_length<Key>::value);
388 template<
class Key,
class Hash>
391 const HashSet<Key, Hash>& a,
392 const HashSet<Key, Hash>&
b 395 HashSet<Key, Hash> result(a);
401 template<
class Key,
class Hash>
404 const HashSet<Key, Hash>& a,
405 const HashSet<Key, Hash>&
b 408 HashSet<Key, Hash> result(a.
capacity());
410 for (
const Key&
k : a)
422 template<
class Key,
class Hash>
425 const HashSet<Key, Hash>& a,
426 const HashSet<Key, Hash>&
b 429 HashSet<Key, Hash> result(a);
435 template<
class Key,
class Hash>
438 const HashSet<Key, Hash>& a,
439 const HashSet<Key, Hash>&
b 442 HashSet<Key, Hash> result(a.
capacity());
444 for (
const Key&
k : a)
458 template<
class Key,
class Hash>
464 static_cast<parent_type&>(*this).begin()
469 template<
class Key,
class Hash>
473 return const_iterator
475 static_cast<const parent_type&>(*this).begin()
480 template<
class Key,
class Hash>
484 return const_iterator
486 static_cast<const parent_type&>(*this).cbegin()
491 template<
class Key,
class Hash>
499 template<
class Key,
class Hash>
507 template<
class Key,
class Hash>
511 return const_iterator();
A HashTable with keys but without contents that is similar to std::unordered_set. ...
void size(const label n)
Older name for setAddressableSize.
this_type & operator^=(const this_type &rhs)
Only retain unique entries (xor)
A 1D vector of objects of type <T> with a fixed length <N>.
iterator begin() noexcept
Return an iterator to begin traversing the FixedList.
bool operator()(const Key &key) const noexcept
Return true if the entry exists, same as contains()
srcOptions insert("case", fileName(rootDirSource/caseDirSource))
bool operator==(const this_type &rhs) const
Sets are equal if all keys are equal, independent of order or underlying storage size.
this_type & operator|=(const this_type &rhs)
Add entries to this HashSet.
iterator end() noexcept
Return an iterator to end traversing the FixedList.
void operator=(const this_type &rhs)
Copy assign.
constexpr const_iterator cend() const noexcept
label k
Boltzmann constant.
void merge(HashSet< Key, Hash > &source)
Attempts to extract entries from source parameter and insert them into this, does not overwrite exist...
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
Base for lists with indirect addressing, templated on the list contents type and the addressing type...
void unset(List< bool > &bools, const labelUList &locations)
Unset the listed locations (assign 'false').
static constexpr label size() noexcept
Return the number of elements in the FixedList.
label size() const noexcept
The number of elements in table.
HashSet() noexcept=default
Default construct: empty without allocation (capacity=0)
bool unset(const Key &key)
Unset the specified key - same as erase.
label capacity() const noexcept
The size of the underlying table (the number of buckets)
Ostream & writeKeys(Ostream &os, const label shortLen=0) const
Write unordered keys (list), with line-breaks when length exceeds shortLen.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
this_type & operator-=(const this_type &rhs)
Remove entries from this HashSet. Uses erase()
A HashTable similar to std::unordered_map.
iterator begin() noexcept
Return an iterator to begin traversing the UList.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
iterator begin()
Return an iterator at begin of list.
iterator end()
Return an iterator at end of list.
this_type & operator &=(const this_type &rhs)
Only retain entries contained in both HashSets.
typename parent_type::key_iterator iterator
An iterator, returning reference to the key.
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
triangles reserve(surf.size())
bool operator[](const Key &key) const noexcept
Return true if the entry exists, same as contains().
this_type & operator+=(const this_type &rhs)
Add entries to this HashSet. Same as the '|=' operator.
typename parent_type::const_key_iterator const_iterator
A const_iterator, returning reference to the key.
iterator end() noexcept
Return an iterator to end traversing the UList.
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
const_iterator cbegin() const
const_iterator cbegin() const
const_iterator set to the beginning of the HashTable
bool operator!=(const this_type &rhs) const
The opposite of the equality operation.
constexpr const_iterator cend() const noexcept
const_iterator to signal the end (for any HashTable)