A HashTable with keys but without contents that is similar to std::unordered_set
.
More...
Public Types | |
typedef HashSet< Key, Hash > | this_type |
The template instance used for this HashSet. More... | |
typedef HashTable< zero::null, Key, Hash > | parent_type |
The template instance used for the parent HashTable. More... | |
using | iterator = typename parent_type::key_iterator |
An iterator, returning reference to the key. More... | |
using | const_iterator = typename parent_type::const_key_iterator |
A const_iterator, returning reference to the key. More... | |
Public Member Functions | |
HashSet () | |
Default construct with default (128) table capacity. More... | |
HashSet (const this_type &rhs) | |
Copy construct. More... | |
HashSet (this_type &&rhs) | |
Move construct. More... | |
HashSet (const label size) | |
Construct given initial table capacity. More... | |
HashSet (Istream &is) | |
Construct from Istream with default table capacity. More... | |
template<unsigned N> | |
HashSet (const FixedList< Key, N > &list) | |
Construct from FixedList of Key. More... | |
HashSet (const UList< Key > &list) | |
Construct from UList of Key. More... | |
template<class Addr > | |
HashSet (const IndirectListBase< Key, Addr > &list) | |
Construct from an indirect list. More... | |
HashSet (std::initializer_list< Key > list) | |
Construct from an initializer list of Key. More... | |
template<class AnyType , class AnyHash > | |
HashSet (const HashTable< AnyType, Key, AnyHash > &tbl) | |
bool | test (const Key &key) const noexcept |
Same as found() - return true if key exists in the set. More... | |
bool | insert (const Key &key) |
Insert a new entry, not overwriting existing entries. More... | |
bool | set (const Key &key) |
Same as insert (no value to overwrite) More... | |
bool | unset (const Key &key) |
Unset the specified key - same as erase. More... | |
template<class InputIter > | |
label | insert (InputIter first, InputIter last) |
Insert keys from the input iterator range. More... | |
label | insert (std::initializer_list< Key > list) |
Insert keys from a initializer list of Key. More... | |
template<unsigned N> | |
label | insert (const FixedList< Key, N > &list) |
Insert keys from the list of Key. More... | |
label | insert (const UList< Key > &list) |
Insert keys from the list of Key. More... | |
template<class Addr > | |
label | insert (const IndirectListBase< Key, Addr > &list) |
Insert keys from the list of Key. More... | |
template<class InputIter > | |
label | set (InputIter first, InputIter last) |
Same as insert (no value to overwrite) More... | |
label | set (std::initializer_list< Key > list) |
Same as insert (no value to overwrite) More... | |
template<unsigned N> | |
label | set (const FixedList< Key, N > &list) |
Same as insert (no value to overwrite) More... | |
label | set (const UList< Key > &list) |
Same as insert (no value to overwrite) More... | |
template<class Addr > | |
label | set (const IndirectListBase< Key, Addr > &list) |
Same as insert (no value to overwrite) More... | |
template<class InputIter > | |
label | setMany (InputIter first, InputIter last) |
Same as insert (no value to overwrite) More... | |
template<class InputIter > | |
label | unset (InputIter first, InputIter last) |
Unset the keys listed in the input iterator range. More... | |
label | unset (std::initializer_list< Key > list) |
Unset the listed keys - same as erase. More... | |
template<unsigned N> | |
label | unset (const FixedList< Key, N > &list) |
Unset the listed keys - same as erase. More... | |
label | unset (const UList< Key > &list) |
Unset the listed keys - same as erase. More... | |
template<class Addr > | |
label | unset (const IndirectListBase< Key, Addr > &list) |
Unset the listed keys - same as erase. More... | |
iterator | begin () |
const_iterator | begin () const |
const_iterator | cbegin () const |
iterator | end () noexcept |
const_iterator | end () const noexcept |
constexpr const_iterator | cend () const noexcept |
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() More... | |
bool | operator[] (const Key &key) const noexcept |
Return true if the entry exists, same as found(). More... | |
void | operator= (const this_type &rhs) |
Copy assign. More... | |
void | operator= (this_type &&rhs) |
Move assign. More... | |
bool | operator== (const this_type &rhs) const |
bool | operator!= (const this_type &rhs) const |
The opposite of the equality operation. More... | |
void | operator= (const UList< Key > &rhs) |
Assignment from a UList of keys. More... | |
template<unsigned N> | |
void | operator= (const FixedList< Key, N > &rhs) |
Assignment from a FixedList of keys. More... | |
void | operator= (std::initializer_list< Key > rhs) |
Assignment from an initializer list of keys. More... | |
this_type & | operator|= (const this_type &rhs) |
Add entries to this HashSet. More... | |
this_type & | operator&= (const this_type &rhs) |
Only retain entries found in both HashSets. More... | |
this_type & | operator^= (const this_type &rhs) |
Only retain unique entries (xor) More... | |
this_type & | operator+= (const this_type &rhs) |
Add entries to this HashSet. Same as the '|=' operator. More... | |
this_type & | operator-= (const this_type &rhs) |
Remove entries from this HashSet. Uses erase() More... | |
template<class UnaryPredicate > | |
List< Key > | tocValues (const UnaryPredicate &, const bool)=delete |
Not applicable for HashSet. More... | |
template<class BinaryPredicate > | |
List< Key > | tocEntries (const BinaryPredicate &, const bool)=delete |
Not applicable for HashSet. More... | |
template<class UnaryPredicate > | |
label | countValues (const UnaryPredicate &, const bool)=delete |
Not applicable for HashSet. More... | |
template<class BinaryPredicate > | |
label | countEntries (const BinaryPredicate &, const bool)=delete |
Not applicable for HashSet. More... | |
template<class UnaryPredicate > | |
label | filterValues (const UnaryPredicate &, const bool)=delete |
Not applicable for HashSet. More... | |
template<class BinaryPredicate > | |
label | filterEntries (const BinaryPredicate &, const bool)=delete |
Not applicable for HashSet. More... | |
template<class InputIter > | |
Foam::label | assignMany (const label nItems, InputIter first, InputIter last) |
template<class InputIter> | |
Foam::label | insert (InputIter first, InputIter last) |
template<unsigned N> | |
Foam::label | insert (const FixedList< Key, N > &list) |
template<class Addr> | |
Foam::label | insert (const IndirectListBase< Key, Addr > &list) |
template<class InputIter> | |
Foam::label | unset (InputIter first, InputIter last) |
template<unsigned N> | |
Foam::label | unset (const FixedList< Key, N > &list) |
template<class Addr> | |
Foam::label | unset (const IndirectListBase< Key, Addr > &list) |
A HashTable with keys but without contents that is similar to std::unordered_set
.
The entries are considered unordered since their placement depends on the method used to generate the hash key index, the table capacity, insertion order etc. When the key order is important, use the sortedToc() method to obtain a list of sorted keys and use that for further access.
typedef HashTable<zero::null, Key, Hash> parent_type |
using iterator = typename parent_type::key_iterator |
using const_iterator = typename parent_type::const_key_iterator |
|
inline |
|
inlineexplicit |
|
explicit |
HashSet | ( | std::initializer_list< Key > | list | ) |
|
inlinenoexcept |
Same as found() - return true if key exists in the set.
Method name compatibility with bitSet and boolList.
Definition at line 180 of file HashSet.H.
Referenced by mappedPatchBase::calcMapping().
|
inline |
Insert a new entry, not overwriting existing entries.
Definition at line 191 of file HashSet.H.
Referenced by polyMeshGeometry::affectedCells(), PDRblock::blockMeshDict(), faPatch::boundaryProcs(), faMesh::boundaryProcs(), decompositionMethod::calcCellCells(), cellToFaceStencil::calcFaceStencil(), solarLoad::calculate(), extractEulerianParticles::calculateAddressing(), primitiveMeshGeometry::checkCellDeterminant(), polyMeshGeometry::checkCellDeterminant(), primitiveMesh::checkCellsZipUp(), primitiveMesh::checkCellVolumes(), primitiveMesh::checkClosedCells(), primitiveMesh::checkCommonOrder(), primitiveMesh::checkConcaveCells(), zone::checkDefinition(), primitiveMesh::checkDuplicateFaces(), primitiveMesh::checkEdgeLength(), primitiveMeshGeometry::checkFaceAngles(), polyMeshGeometry::checkFaceAngles(), primitiveMesh::checkFaceAngles(), primitiveMeshGeometry::checkFaceArea(), polyMeshGeometry::checkFaceArea(), primitiveMesh::checkFaceAreas(), primitiveMeshGeometry::checkFaceDotProduct(), polyMeshGeometry::checkFaceFlatness(), primitiveMesh::checkFaceFlatness(), primitiveMesh::checkFaceOrthogonality(), primitiveMeshGeometry::checkFacePyramids(), polyMeshGeometry::checkFacePyramids(), primitiveMesh::checkFacePyramids(), primitiveMeshGeometry::checkFaceSkewness(), polyMeshGeometry::checkFaceSkewness(), primitiveMesh::checkFaceSkewness(), polyMeshTetDecomposition::checkFaceTets(), polyMeshGeometry::checkFaceTets(), primitiveMeshGeometry::checkFaceTwist(), polyMeshGeometry::checkFaceTwist(), primitiveMesh::checkFaceVertices(), primitiveMeshGeometry::checkFaceWeights(), polyMeshGeometry::checkFaceWeights(), PatchTools::checkOrientation(), PrimitivePatch<::Foam::List< labelledTri >, pointField >::checkPointManifold(), primitiveMesh::checkPointNearness(), primitiveMesh::checkPoints(), PrimitivePatch<::Foam::List< labelledTri >, pointField >::checkTopology(), polyMeshGeometry::checkTriangleTwist(), primitiveMesh::checkUpperTriangular(), polyMeshGeometry::checkVolRatio(), meshRefinement::createBaffles(), box::createMap(), geomCellLooper::cut(), structuredDecomp::decompose(), faMeshDecomposition::decomposeMesh(), meshRefinement::doRemovePoints(), Foam::getAcceptableFunctionKeys(), combineFaces::getMergeSets(), surfaceSets::getSurfaceSets(), triSurfaceTools::getVertexVertices(), ZoneMesh< cellZone, polyMesh >::indices(), polyBoundaryMesh::indices(), cellToCellStencil::insertFaceCells(), cellToFaceStencil::insertFaceCells(), isoSurfaceTopo::isoSurfaceTopo(), seriesWriter::load(), faceAreaWeightAMI2D::overlappingTgtFaces(), InflationInjection< CloudType >::parcelsToInject(), ParticleErosion< CloudType >::ParticleErosion(), polyBoundaryMesh::patchSet(), Foam::polyMeshZipUpCells(), probes::prepare(), Foam::printBadEntries(), NASsurfaceFormat< Face >::read(), AMIWeights::read(), wallHeatFlux::read(), wallShearStress::read(), functionObjectList::readFunctionObject(), triSurface::readTypes(), structuredRenumber::renumber(), faMeshBoundaryHalo::reset(), vtuSizing::reset(), motionSmootherAlgo::scaleMesh(), mapDistributeBase::schedule(), HashSet< word, Hash< word > >::set(), cellSetOption::setCellSelection(), lumpedPointMovement::setInterpolator(), HashSet< word, Hash< word > >::setMany(), lumpedPointMovement::setPatchControl(), removePoints::setRefinement(), faGlobalMeshData::updateMesh(), cuttingSurfaceBase::walkCellCuts(), Foam::meshTools::writeOBJ(), triSurface::writeStats(), isoAdvection::writeSurfaceCells(), and triSurface::writeTypes().
|
inline |
Same as insert (no value to overwrite)
Definition at line 197 of file HashSet.H.
Referenced by mappedPatchBase::calcMapping(), Foam::checkFireEdges(), lumpedPointMovement::readDict(), Foam::BitOps::set(), and topoSet::set().
|
inline |
Unset the specified key - same as erase.
Definition at line 204 of file HashSet.H.
Referenced by turbulenceFields::initialise(), Foam::listSwitches(), Foam::BitOps::unset(), and topoSet::unset().
|
inline |
Insert keys from the input iterator range.
|
inline |
Insert keys from the list of Key.
|
inline |
|
inline |
Insert keys from the list of Key.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Unset the keys listed in the input iterator range.
|
inline |
Unset the listed keys - same as erase.
|
inline |
|
inline |
Unset the listed keys - same as erase.
|
inline |
Definition at line 446 of file HashSet.C.
Referenced by Foam::HashSetOps::bitset(), and Foam::HashSetOps::bools().
|
inline |
|
inline |
Definition at line 468 of file HashSet.C.
Referenced by HashSet< word, Hash< word > >::operator==(), HashSet< word, Hash< word > >::operator^=(), and HashSet< word, Hash< word > >::operator|=().
|
inlinenoexcept |
Definition at line 479 of file HashSet.C.
Referenced by Foam::HashSetOps::bitset(), and Foam::HashSetOps::bools().
|
inlinenoexcept |
|
inlineconstexprnoexcept |
Definition at line 495 of file HashSet.C.
Referenced by HashSet< word, Hash< word > >::operator==(), HashSet< word, Hash< word > >::operator^=(), and HashSet< word, Hash< word > >::operator|=().
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
void operator= | ( | const UList< Key > & | rhs | ) |
void operator= | ( | std::initializer_list< Key > | rhs | ) |
Foam::HashSet< Key, Hash > & operator|= | ( | const this_type & | rhs | ) |
|
inline |
Foam::HashSet< Key, Hash > & operator^= | ( | const this_type & | rhs | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |