A HashTable with keys but without contents. More...
#include <OpenFOAM/HashSet.H>
A HashTable with keys but without contents.
Inheritance diagram for HashSet< Key, Hash >:
Collaboration diagram for HashSet< Key, Hash >:Public Types | |
| typedef HashTable< nil, Key, Hash >::iterator | iterator |
| typedef HashTable< nil, Key, Hash >::const_iterator | const_iterator |
Public Types inherited from HashTable< nil, Key, Hash > | |
| typedef nil | value_type |
| Type of values the HashTable contains. | |
| typedef nil & | reference |
| Type that can be used for storing into HashTable::value_type. | |
| typedef const nil & | const_reference |
| Type that can be used for storing into constant. | |
| typedef label | size_type |
| The type that can represent the size of a HashTable. | |
Public Member Functions | |
| HashSet (const label size=128) | |
| Construct given initial size. | |
| HashSet (Istream &is) | |
| Construct from Istream. | |
| HashSet (const UList< Key > &lst) | |
| Construct from UList of Key. | |
| HashSet (const HashSet< Key, Hash > &hs) | |
| Construct as copy. | |
| HashSet (const Xfer< HashSet< Key, Hash > > &hs) | |
| Construct by transferring the parameter contents. | |
| HashSet (const Xfer< HashTable< nil, Key, Hash > > &hs) | |
| Construct by transferring the parameter contents. | |
| template<class AnyType , class AnyHash > | |
| HashSet (const HashTable< AnyType, Key, AnyHash > &) | |
| Construct from the keys of another HashTable,. | |
| bool | insert (const Key &key) |
| Insert a new entry. | |
| bool | set (const Key &key) |
| Same as insert (cannot overwrite nil content) | |
| bool | operator[] (const Key &) const |
| Return true if the entry exists, same as found() | |
| bool | operator== (const HashSet< Key, Hash > &) const |
| Equality. Two hashtables are equal when their contents are equal. | |
| bool | operator!= (const HashSet< Key, Hash > &) const |
| The opposite of the equality operation. | |
| void | operator|= (const HashSet< Key, Hash > &) |
| Combine entries from HashSets. | |
| void | operator&= (const HashSet< Key, Hash > &) |
| Only retain entries found in both HashSets. | |
| void | operator^= (const HashSet< Key, Hash > &) |
| Only retain unique entries (xor) | |
| void | operator+= (const HashSet< Key, Hash > &rhs) |
| Add entries listed in the given HashSet to this HashSet. | |
| void | operator-= (const HashSet< Key, Hash > &) |
| Remove entries listed in the given HashSet from this HashSet. | |
Public Member Functions inherited from HashTable< nil, Key, Hash > | |
| bool | set (const Key &, const nil &newElmt) |
| Assign a new hashedEntry, overwriting existing entries. | |
| HashTable (const label size=128) | |
| Construct given initial table size. | |
| HashTable (Istream &, const label size=128) | |
| Construct from Istream. | |
| HashTable (const HashTable< nil, Key, Hash > &) | |
| Construct as copy. | |
| HashTable (const Xfer< HashTable< nil, Key, Hash > > &) | |
| Construct by transferring the parameter contents. | |
| ~HashTable () | |
| label | size () const |
| Return number of elements in table. | |
| bool | empty () const |
| Return true if the hash table is empty. | |
| bool | found (const Key &) const |
| Return true if hashedEntry is found in table. | |
| iterator | find (const Key &) |
| Find and return an iterator set at the hashedEntry. | |
| const_iterator | find (const Key &) const |
| Find and return an const_iterator set at the hashedEntry. | |
| List< Key > | toc () const |
| Return the table of contents. | |
| List< Key > | sortedToc () const |
| Return the table of contents as a sorted list. | |
| Ostream & | printInfo (Ostream &) const |
| Print information. | |
| bool | insert (const Key &, const nil &newElmt) |
| Insert a new hashedEntry. | |
| bool | erase (const iterator &) |
| Erase an hashedEntry specified by given iterator. | |
| bool | erase (const Key &) |
| Erase an hashedEntry specified by given key if in table. | |
| label | erase (const UList< Key > &) |
| Remove entries given by the listed keys from this HashTable. | |
| label | erase (const HashTable< AnyType, Key, AnyHash > &) |
| Remove entries given by the given keys from this HashTable. | |
| void | resize (const label newSize) |
| Resize the hash table for efficiency. | |
| void | clear () |
| Clear all entries from table. | |
| void | clearStorage () |
| Clear the table entries and the table itself. | |
| void | transfer (HashTable< nil, Key, Hash > &) |
| Transfer the contents of the argument table into this table. | |
| Xfer< HashTable< nil, Key, Hash > > | xfer () |
| Transfer contents to the Xfer container. | |
| nil & | operator[] (const Key &) |
| Find and return an hashedEntry. | |
| nil & | operator() (const Key &) |
| Find and return an hashedEntry, create it null if not present. | |
| void | operator= (const HashTable< nil, Key, Hash > &) |
| Assignment. | |
| bool | operator== (const HashTable< nil, Key, Hash > &) const |
| Equality. Two hash tables are equal if all contents of first are. | |
| bool | operator!= (const HashTable< nil, Key, Hash > &) const |
| The opposite of the equality operation. Takes linear time. | |
| iterator | begin () |
| iterator set to the begining of the HashTable | |
| const_iterator | begin () const |
| const_iterator set to the beginning of the HashTable | |
| const iterator & | end () |
| iterator set to beyond the end of the HashTable | |
| const const_iterator & | end () const |
| const_iterator set to beyond the end of the HashTable | |
| const_iterator | cbegin () const |
| const_iterator set to the beginning of the HashTable | |
| const const_iterator & | cend () const |
| const_iterator set to beyond the end of the HashTable | |
Reimplemented from HashTable< nil, Key, Hash >.
| typedef HashTable<nil, Key, Hash>::const_iterator const_iterator |
Reimplemented from HashTable< nil, Key, Hash >.
|
inline |
Construct from the keys of another HashTable,.
the type of values held is arbitrary.
Definition at line 36 of file HashSet.C.
References HashTable< T, Key, Hash >::cbegin(), HashTable< T, Key, Hash >::cend(), and insert().
|
inline |
Insert a new entry.
Definition at line 123 of file HashSet.H.
Referenced by meshRefinement::baffleAndSplitMesh(), cellToFaceStencil::calcFaceStencil(), primitiveMeshGeometry::checkCellDeterminant(), polyMeshGeometry::checkCellDeterminant(), primitiveMesh::checkCellDeterminant(), primitiveMesh::checkCellsZipUp(), primitiveMesh::checkCellVolumes(), primitiveMesh::checkClosedCells(), primitiveMesh::checkEdgeAlignment(), primitiveMesh::checkEdgeLength(), primitiveMeshGeometry::checkFaceAngles(), polyMeshGeometry::checkFaceAngles(), primitiveMesh::checkFaceAngles(), primitiveMeshGeometry::checkFaceArea(), polyMeshGeometry::checkFaceArea(), primitiveMesh::checkFaceAreas(), primitiveMeshGeometry::checkFaceDotProduct(), primitiveMesh::checkFaceFlatness(), primitiveMesh::checkFaceOrthogonality(), primitiveMeshGeometry::checkFacePyramids(), polyMeshGeometry::checkFacePyramids(), primitiveMesh::checkFacePyramids(), primitiveMeshGeometry::checkFaceSkewness(), polyMeshGeometry::checkFaceSkewness(), primitiveMesh::checkFaceSkewness(), primitiveMeshGeometry::checkFaceTwist(), polyMeshGeometry::checkFaceTwist(), primitiveMesh::checkFaceVertices(), primitiveMeshGeometry::checkFaceWeights(), polyMeshGeometry::checkFaceWeights(), PatchTools::checkOrientation(), PrimitivePatch< Face, FaceList, PointField, PointType >::checkPointManifold(), primitiveMesh::checkPointNearness(), primitiveMesh::checkPoints(), PrimitivePatch< Face, FaceList, PointField, PointType >::checkTopology(), polyMeshGeometry::checkTriangleTwist(), primitiveMesh::checkUpperTriangular(), polyMeshGeometry::checkVolRatio(), meshRefinement::createBaffles(), geomCellLooper::cut(), treeLeaf< Type >::findBox(), meshRefinement::getDuplicateFaces(), combineFaces::getMergeSets(), surfaceSets::getSurfaceSets(), triSurfaceTools::getVertexVertices(), HashSet< word >::HashSet(), HashSet< word >::insert(), cellToCellStencil::insertFaceCells(), cellToFaceStencil::insertFaceCells(), meshRefinement::mergeEdges(), polyBoundaryMesh::patchSet(), Foam::polyMeshZipUpCells(), NASsurfaceFormat< Face >::read(), motionSmoother::scaleMesh(), mapDistribute::schedule(), HashSet< word >::set(), TimeActivatedExplicitSource< Type >::setCellSet(), removePoints::setRefinement(), explicitSource::setSelectedCellsFromPoints(), surfaceIntersection::surfaceIntersection(), pointSet::sync(), and STARCD::writeSurface().
|
inline |
|
inline |
Return true if the entry exists, same as found()
Reimplemented from HashTable< nil, Key, Hash >.
Equality. Two hashtables are equal when their contents are equal.
Independent of table size or order.
Definition at line 65 of file HashSet.C.
References HashTable< nil, Key, Hash >::cbegin(), HashTable< nil, Key, Hash >::cend(), and HashTable< nil, Key, Hash >::found().
The opposite of the equality operation.
Definition at line 90 of file HashSet.C.
References Foam::operator==().
Combine entries from HashSets.
Definition at line 97 of file HashSet.C.
References HashTable< nil, Key, Hash >::cbegin(), HashTable< nil, Key, Hash >::cend(), and insert().
Referenced by HashSet< word >::operator+=().
Only retain entries found in both HashSets.
Definition at line 108 of file HashSet.C.
References HashTable< nil, Key, Hash >::found().
Only retain unique entries (xor)
Definition at line 122 of file HashSet.C.
References HashTable< nil, Key, Hash >::cbegin(), HashTable< nil, Key, Hash >::cend(), and insert().
Remove entries listed in the given HashSet from this HashSet.
Definition at line 141 of file HashSet.C.
References HashTable< nil, Key, Hash >::cbegin(), and HashTable< nil, Key, Hash >::cend().