Data Structures | Public Types | Public Member Functions | Data Fields | Private Member Functions | Static Private Member Functions | Private Attributes | Friends
HashTable Class Reference

An STL-conforming hash table. More...

Collaboration diagram for HashTable:
Collaboration graph
[legend]

Data Structures

class  const_iterator
 An STL-conforming const_iterator. More...
 
struct  hashedEntry
 Structure to hold a hashed entry with SLList for collisions. More...
 
class  iterator
 An STL-conforming iterator. More...
 
class  iteratorBase
 The iterator base for HashTable. More...
 

Public Types

typedef T value_type
 Type of values the HashTable contains. More...
 
typedef Treference
 Type that can be used for storing into HashTable::value_type. More...
 
typedef label size_type
 The type that can represent the size of a HashTable. More...
 

Public Member Functions

 HashTable (const label size=128)
 Construct given initial table size. More...
 
 HashTable (Istream &, const label size=128)
 Construct from Istream. More...
 
 HashTable (const HashTable< T, Key, Hash > &)
 Construct as copy. More...
 
 HashTable (const Xfer< HashTable< T, Key, Hash > > &)
 Construct by transferring the parameter contents. More...
 
 ~HashTable ()
 Destructor. More...
 
label capacity () const
 The size of the underlying table. More...
 
label size () const
 Return number of elements in table. More...
 
bool empty () const
 Return true if the hash table is empty. More...
 
bool found (const Key &) const
 Return true if hashedEntry is found in table. More...
 
iterator find (const Key &)
 Find and return an iterator set at the hashedEntry. More...
 
const_iterator find (const Key &) const
 Find and return an const_iterator set at the hashedEntry. More...
 
List< Key > toc () const
 Return the table of contents. More...
 
List< Key > sortedToc () const
 Return the table of contents as a sorted list. More...
 
OstreamprintInfo (Ostream &) const
 Print information. More...
 
bool insert (const Key &, const T &newElmt)
 Insert a new hashedEntry. More...
 
bool set (const Key &, const T &newElmt)
 Assign a new hashedEntry, overwriting existing entries. More...
 
bool erase (const iterator &)
 Erase a hashedEntry specified by given iterator. More...
 
bool erase (const Key &)
 Erase a hashedEntry specified by the given key. More...
 
label erase (const UList< Key > &)
 Remove entries given by the listed keys from this HashTable. More...
 
template<class AnyType , class AnyHash >
label erase (const HashTable< AnyType, Key, AnyHash > &)
 Remove entries given by the given keys from this HashTable. More...
 
void resize (const label newSize)
 Resize the hash table for efficiency. More...
 
void clear ()
 Clear all entries from table. More...
 
void clearStorage ()
 Clear the table entries and the table itself. More...
 
void shrink ()
 Shrink the allocated table to approx. twice number of elements. More...
 
void transfer (HashTable< T, Key, Hash > &)
 Transfer the contents of the argument table into this table. More...
 
Xfer< HashTable< T, Key, Hash > > xfer ()
 Transfer contents to the Xfer container. More...
 
Toperator[] (const Key &)
 Find and return a hashedEntry. More...
 
const Toperator[] (const Key &) const
 Find and return a hashedEntry. More...
 
Toperator() (const Key &)
 Find and return a hashedEntry, create it null if not present. More...
 
void operator= (const HashTable< T, Key, Hash > &)
 Assignment. More...
 
bool operator== (const HashTable< T, Key, Hash > &) const
 Equality. Hash tables are equal if the keys and values are equal. More...
 
bool operator!= (const HashTable< T, Key, Hash > &) const
 The opposite of the equality operation. Takes linear time. More...
 
iterator begin ()
 Iterator set to the beginning of the HashTable. More...
 
const_iterator cbegin () const
 const_iterator set to the beginning of the HashTable More...
 
const_iterator begin () const
 const_iterator set to the beginning of the HashTable More...
 
template<class AnyType , class AnyHash >
Foam::label erase (const HashTable< AnyType, Key, AnyHash > &rhs)
 

Data Fields

const typedef Tconst_reference
 Type that can be used for storing into constant. More...
 

Private Member Functions

label hashKeyIndex (const Key &) const
 Return the hash index of the Key within the current table size. More...
 
bool set (const Key &, const T &newElmt, bool protect)
 Assign a new hashedEntry to a possibly already existing key. More...
 

Static Private Member Functions

static label canonicalSize (const label)
 Return a canonical (power-of-two) size. More...
 

Private Attributes

label nElmts_
 The current number of elements in table. More...
 
label tableSize_
 Number of primary entries allocated in table. More...
 
hashedEntry ** table_
 The table of primary entries. More...
 

Friends

template<class T2 , class Key2 , class Hash2 >
class HashPtrTable
 Declare friendship with the HashPtrTable class. More...
 
class iteratorBase
 Declare friendship with the iteratorBase. More...
 
class iterator
 Declare friendship with the iterator. More...
 
class const_iterator
 Declare friendship with the const_iterator. More...
 
Istreamoperator>> (Istream &, HashTable< T, Key, Hash > &)
 
Ostreamoperator (Ostream &, const HashTable< T, Key, Hash > &)
 

Detailed Description

An STL-conforming hash table.

Note
Hashing index collisions are handled via chaining using a singly-linked list with the colliding entry being added to the head of the linked list. Thus copying the hash table (or indeed even resizing it) will often result in a different hash order. Use a sorted table-of-contents when the hash order is important.
Source files

Definition at line 61 of file HashTable.H.

Member Typedef Documentation

◆ value_type

typedef T value_type

Type of values the HashTable contains.

Definition at line 321 of file HashTable.H.

◆ reference

typedef T& reference

Type that can be used for storing into HashTable::value_type.

objects. This type is usually List::value_type&.

Definition at line 325 of file HashTable.H.

◆ size_type

typedef label size_type

The type that can represent the size of a HashTable.

Definition at line 333 of file HashTable.H.

Constructor & Destructor Documentation

◆ HashTable() [1/4]

HashTable ( const label  size = 128)

Construct given initial table size.

◆ HashTable() [2/4]

HashTable ( Istream ,
const label  size = 128 
)

Construct from Istream.

◆ HashTable() [3/4]

HashTable ( const HashTable< T, Key, Hash > &  )

Construct as copy.

◆ HashTable() [4/4]

HashTable ( const Xfer< HashTable< T, Key, Hash > > &  )

Construct by transferring the parameter contents.

◆ ~HashTable()

~HashTable ( )

Destructor.

Definition at line 96 of file HashTable.C.

Member Function Documentation

◆ canonicalSize()

static label canonicalSize ( const  label)
staticprivate

Return a canonical (power-of-two) size.

◆ hashKeyIndex()

Foam::label hashKeyIndex ( const Key &  key) const
inlineprivate

Return the hash index of the Key within the current table size.

No checks for zero-sized tables.

Definition at line 48 of file HashTableI.H.

◆ set() [1/2]

bool set ( const Key &  ,
const T newElmt,
bool  protect 
)
private

Assign a new hashedEntry to a possibly already existing key.

Referenced by main().

Here is the caller graph for this function:

◆ capacity()

Foam::label capacity ( ) const
inline

The size of the underlying table.

Definition at line 58 of file HashTableI.H.

Referenced by main().

Here is the caller graph for this function:

◆ size()

Foam::label size ( ) const
inline

Return number of elements in table.

Definition at line 65 of file HashTableI.H.

Referenced by singleProcessorFaceSetsConstraint::add(), polyMeshGenModifier::addBufferCells(), normalToFace::applyToSet(), cellCuts::calcAnchors(), polyDualMesh::calcDual(), FECCellToFaceStencil::calcFaceStencil(), cellToFaceStencil::calcFaceStencil(), globalMeshData::calcSharedEdges(), meshSurfacePartitioner::calculateCornersEdgesAndAddressing(), triSurfAddressing::calculateFacetFacetsEdges(), globalPoints::calculateSharedPoints(), boundaryMesh::changeFaces(), checkIrregularSurfaceConnections::checkAndFixIrregularConnections(), meshOctreeAddressing::checkAndFixIrregularConnections(), autoLayerDriver::checkAndUnmark(), polyMesh::checkEdgeAlignment(), primitiveMesh::checkEdgeAlignment(), checkIrregularSurfaceConnections::checkEdgeFaceConnections(), primitiveMesh::checkEdgeLength(), checkIrregularSurfaceConnections::checkFaceGroupsAtBndVertices(), edgeExtractor::checkFacePatchesGeometry(), Foam::checkGeometry(), meshOctreeAddressing::checkGluedRegions(), motionSmootherAlgo::checkMesh(), autoLayerDriver::checkMeshManifold(), Foam::checkMeshQuality(), edgeCollapser::checkMeshQuality(), Foam::checkTopology(), coalCloudList::coalCloudList(), faceToCell::combine(), pointToFace::combine(), hexRef8::consistentSlowRefinement2(), meshToMesh::constructFromCuttingPatches(), inversePointDistanceDiffusivity::correct(), cyclicPolyPatch::coupledEdges(), autoRefineDriver::danglingCellRefine(), doCommand(), autoLayerDriver::doLayers(), autoRefineDriver::doRefine(), autoSnapDriver::doSnap(), extractSurface(), combineFaces::faceNeighboursValid(), meshOptimizer::findBadFaces(), Foam::polyMeshGenChecks::findBadFaces(), Foam::polyMeshGenChecks::findBadFacesRelaxed(), findBaffles(), meshRefinement::findEdgeConnectedProblemCells(), meshOptimizer::findLowQualityFaces(), Foam::polyMeshGenChecks::findLowQualityFaces(), findMatches(), faceCoupleInfo::findSlavesCoveringMaster(), Foam::polyMeshGenChecks::findWorstQualityFaces(), surfaceSets::getHangingCells(), combineFaces::getMergeSets(), cellDistFuncs::getPointNeighbours(), removePoints::getUnrefimentSet(), autoLayerDriver::handleNonManifolds(), meshRefinement::handleSnapProblems(), injectionModelList::injectionModelList(), Foam::interpolatePointToCell(), topoSet::invert(), layerParameters::layerParameters(), main(), immersedBoundaryFvPatch::makeTriAddressing(), fvMeshDistribute::mapBoundaryFields(), fvMeshDistribute::mapExposedFaces(), meshRefinement::markFacesOnProblemCells(), meshRefinement::markFacesOnProblemCellsGeometric(), meshRefinement::markFeatureCellLevel(), meshToMesh::maskCells(), polyBoundaryMesh::matchGroups(), cellToCellStencil::merge(), cellToFaceStencil::merge(), Foam::mergeAndWrite(), edgeMesh::mergeEdges(), meshRefinement::mergeEdgesUndo(), meshRefinement::mergePatchFacesUndo(), surfaceMorpherCells::morphBoundaryFaces(), surfaceMorpherCells::morphInternalFaces(), MRFZone::MRFZone(), polyBoundaryMesh::neighbourEdges(), Foam::help::numberOfEdgeGroups(), Foam::help::numberOfFaceGroups(), HashTable< Foam::autoPtr< Foam::interfaceCompositionModel > >::operator==(), symmetryPlaneOptimisation::optimizeSymmetryPlanes(), Foam::polyMeshZipUpCells(), printAllSets(), wallBoundedStreamLine::read(), dynamicRefineFvMesh::refine(), autoRefineDriver::refinementInterfaceRefine(), checkNonMappableCellConnections::removeCells(), structuredRenumber::renumber(), polyTopoChange::renumber(), faceAreaWeightAMI< SourcePatch, TargetPatch >::restartUncoveredSourceFace(), fvMeshDistribute::saveBoundaryFields(), fvMeshDistribute::saveInternalFields(), motionSmootherAlgo::scaleMesh(), MRFZone::setMRFFaces(), removePoints::setRefinement(), hexRef8::setRefinement(), hexRef8::setUnrefinement(), meshRefinement::splitFacesUndo(), topoSet::subset(), surfaceFeatures::surfaceFeatures(), extendedUpwindCellToFaceStencil::transportStencil(), meshOptimizer::untangleBoundaryLayer(), updateCellSet(), domainDecomposition::writeDecomposition(), autoLayerDriver::writeLayerSets(), writeVTK(), inverseDistanceDiffusivity::y(), polyMeshGenModifier::zipUpCells(), and meshRefinement::zonify().

◆ empty()

bool empty ( ) const
inline

Return true if the hash table is empty.

Definition at line 72 of file HashTableI.H.

Referenced by forces::calcForcesMoment(), patchToFace::combine(), and globalIndexAndTransform::transformIndicesForPatches().

Here is the caller graph for this function:

◆ found()

bool found ( const Key &  key) const

Return true if hashedEntry is found in table.

Definition at line 109 of file HashTable.C.

Referenced by refineImmersedBoundaryMesh::addIbCellCellFaces(), refineImmersedBoundaryMesh::addIbCellCells(), refineImmersedBoundaryMesh::addIbCells(), immersedBoundaryFvPatch::addIbCornerCells(), autoLayerDriver::addLayers(), fieldAverage::addMeanFieldType(), searchableSurfaceToFaceZone::applyToSet(), setToCellZone::applyToSet(), faceZoneToFaceZone::applyToSet(), setToPointZone::applyToSet(), setToFaceZone::applyToSet(), setAndNormalToFaceZone::applyToSet(), setsToFaceZone::applyToSet(), meshToMesh0::calcAddressing(), meshSurfaceEngine::calcGlobalBoundaryPointLabels(), meshRefinement::calcNeighbourData(), meshSurfaceEngine::calculateBoundaryNodes(), boundaryLayerOptimisation::calculateHairEdges(), autoLayerDriver::cellsUseFace(), meshOctreeAddressing::checkAndFixIrregularConnections(), Foam::polyMeshGenChecks::checkCellPartTetrahedra(), edgeExtractor::checkCorners(), checkIrregularSurfaceConnections::checkEdgeFaceConnections(), decomposeCells::checkFaceConnections(), Foam::polyMeshGenChecks::checkFaceFlatness(), edgeExtractor::checkFacePatchesGeometry(), Foam::polyMeshGenChecks::checkFacePyramids(), meshOctreeAddressing::checkGluedRegions(), edgeMeshFormatsCore::checkSupport(), surfaceFormatsCore::checkSupport(), boundaryLayers::checkTopologyOfBoundaryFaces(), meshSurfaceCheckInvertedVertices::checkVertices(), triSurfaceTools::collapseCreatesFold(), triSurfaceTools::collapseMinCosAngle(), meshRefinement::collectFaces(), pointToCell::combine(), pointToFace::combine(), cellToFace::combine(), inverseFaceDistanceDiffusivity::correct(), inversePointDistanceDiffusivity::correct(), motionSmootherAlgo::correctBoundaryConditions(), cellDistFuncs::correctBoundaryFaceCells(), cellDistFuncs::correctBoundaryPointCells(), slidingInterface::coupleInterface(), boundaryLayers::createLayerCells(), edgeExtractor::cornerEvaluator::createParallelAddressing(), curvatureSeparation::curvatureSeparation(), hexCellLooper::cut(), geomCellLooper::cut(), Foam::meshTools::cutDirToEdge(), cellZoneSet::deleteSet(), pointZoneSet::deleteSet(), attachDetach::detachInterface(), edgeCollapser::determineDuplicatePointsOnFace(), triSurfaceTools::edgeCosAngle(), meshOctreeModifier::ensureCorrectRegularity(), HashTable< Foam::autoPtr< Foam::interfaceCompositionModel > >::erase(), Foam::help::exchangeMap(), polyMeshFilter::filter(), removeFaces::filterFace(), surfaceMorpherCells::findBoundaryVertices(), immersedBoundaryFvPatch::findCellCells(), meshOctreeCube::findContainedEdges(), findCellsIntersectingSurface::findIntersectedCells(), meshSurfaceOptimizer::findInvertedVertices(), meshOctree::findNearestCorner(), boundaryLayers::findPatchesToBeTreatedTogether(), surfaceSets::getHangingCells(), triSurfaceTools::getMergedEdges(), cellDistFuncs::getPointNeighbours(), removePoints::getUnrefimentSet(), autoLayerDriver::handleNonManifolds(), surfaceInterpolateFields::interpolateFields(), topoSet::invert(), main(), immersedBoundaryFvPatch::makeIbCellCells(), immersedBoundaryFvPatch::makeIbCells(), immersedBoundaryFvPatch::makeIbInsideFaces(), immersedBoundaryFvPatch::makeIbInternalFaces(), immersedBoundaryFvPatch::makeTriAddressing(), meshSurfaceMapper::mapCorners(), meshSurfaceMapper2D::mapCorners(), fvMeshAdder::MapDimFields(), fvMeshDistribute::mapExposedFaces(), fvMeshAdder::MapSurfaceFields(), meshSurfaceMapper::mapVerticesOntoSurfacePatches(), fvMeshAdder::MapVolFields(), meshOctreeModifier::markAdditionalLayers(), meshOctreeModifier::markAdditionalLayersOfFaceNeighbours(), cellDistFuncs::maxPatchSize(), merge(), removeFaces::mergeFaces(), meshRefinement::mergePatchFacesUndo(), polyMeshAdder::mergePrimitives(), chemkinReader::molecularWeight(), meshSurfaceOptimizer::newEdgePositionLaplacian(), Foam::help::numberOfEdgeGroups(), Foam::help::numberOfFaceGroups(), InflationInjection< CloudType >::parcelsToInject(), partTetMesh::partTetMesh(), partTriMesh::partTriMesh(), boundaryMesh::patchify(), slidingInterface::projectPoints(), meshOctreeCreator::refineBoxesNearDataBoxes(), layerAdditionRemoval::removeCellLayer(), reorderMesh(), fieldAverage::resetFields(), faceAreaWeightAMI< SourcePatch, TargetPatch >::restartUncoveredSourceFace(), meshOctreeInsideOutside::reviseDataBoxes(), globalPoints::sendPatchPoints(), fvMeshSubset::setCellSubset(), patchWave::setChangedFaces(), patchDataWave< TransferType >::setChangedFaces(), motionSmootherAlgo::setDisplacementPatchFields(), MRFZone::setMRFFaces(), meshRefinement::splitFacesUndo(), topoSet::subset(), cellDistFuncs::sumPatchSize(), surfaceIntersection::surfaceIntersection(), medialAxisMeshMover::update(), setUpdater::updateSets(), polyMeshFilter::updateSets(), topoSetSource::usage(), triSurfaceTools::vertexUsesFace(), wallLayerCells::wallLayerCells(), domainDecomposition::writeDecomposition(), and writeVTK().

◆ find() [1/2]

iterator find ( const Key &  )

◆ find() [2/2]

const_iterator find ( const Key &  ) const

Find and return an const_iterator set at the hashedEntry.

If not found iterator = end()

◆ toc()

Foam::List< Key > toc ( ) const

Return the table of contents.

Definition at line 201 of file HashTable.C.

Referenced by layerAdditionRemoval::addCellLayer(), immersedBoundaryFvPatch::addIbCornerCells(), primitiveMeshGeometry::affectedCells(), polyMeshGeometry::affectedCells(), attachDetach::attachInterface(), slidingInterface::calcAttachedAddressing(), PrimitivePatch< labelledTri, List, pointField, point >::calcBdryPoints(), cellToCellStencil::calcFaceCells(), cellToFaceStencil::calcFaceCells(), surfaceFormatsCore::checkSupport(), regionToFace::combine(), vtkPV4Foam::convertVolField(), vtkPV3Foam::convertVolFields(), slidingInterface::coupleInterface(), meshRefinement::createBaffles(), autoRefineDriver::danglingCellRefine(), attachDetach::detachInterface(), immersedBoundaryFvPatch::findCellCells(), findCellsIntersectingSurface::findIntersectedCells(), faceCoupleInfo::findSlavesCoveringMaster(), dynamicIndexedOctree::findSphere(), indexedOctree< Foam::treeDataFace >::findSphere(), motionSmootherAlgo::getAffectedFacesAndPoints(), cellDistFuncs::getPointNeighbours(), removePoints::getUnrefimentSet(), triSurfaceTools::getVertexVertices(), InflationInjection< CloudType >::InflationInjection(), main(), immersedBoundaryFvPatch::makeIbCellCells(), immersedBoundaryFvPatch::makeIbCells(), immersedBoundaryFvPatch::makeIbInsideFaces(), immersedBoundaryFvPatch::makeIbInternalFaces(), immersedBoundaryFvPatch::makeTriAddressing(), Foam::MapConsistentSubMesh(), cellClassification::markCells(), merge(), objectRegistry::names(), cellToFaceStencil::unionEqOp::operator()(), cellToCellStencil::unionEqOp::operator()(), ParticleErosion< CloudType >::ParticleErosion(), PatchPostProcessing< CloudType >::PatchPostProcessing(), Foam::polyMeshZipUpCells(), slidingInterface::projectPoints(), polyMeshGenPoints::read(), polyMeshGenCells::read(), residuals::read(), polyMeshGenFaces::read(), triSurface::readTRI(), refineImmersedBoundaryMesh::refinementCells(), autoRefineDriver::refinementInterfaceRefine(), layerAdditionRemoval::removeCellLayer(), cellSetOption::setCellSet(), fvMeshSubset::setCellSubset(), hexRef8::setUnrefinement(), uniformInterpolatedDisplacementPointPatchVectorField::updateCoeffs(), meshOctreeModifier::updateCommunicationPattern(), Foam::meshTools::writeOBJ(), and polyMeshGenModifier::zipUpCells().

◆ sortedToc()

Foam::List< Key > sortedToc ( ) const

◆ printInfo()

Foam::Ostream & printInfo ( Ostream os) const

Print information.

Definition at line 58 of file HashTableIO.C.

Referenced by main().

Here is the caller graph for this function:

◆ insert()

bool insert ( const Key &  key,
const T newElmt 
)
inline

Insert a new hashedEntry.

Definition at line 80 of file HashTableI.H.

Referenced by triSurfaceMesh::addFaceToEdge(), meshRefinement::allocateInterRegionFaceZone(), globalMeshData::calcSharedEdges(), polyMesh::checkEdgeAlignment(), primitiveMesh::checkEdgeAlignment(), objectRegistry::checkIn(), Foam::checkWedges(), meshStructure::correct(), patchPatchDist::correct(), globalMeshData::countSharedEdges(), cyclicPolyPatch::coupledEdges(), cyclicGAMGInterface::cyclicGAMGInterface(), autoRefineDriver::doRefine(), extractPatchGroups(), extractSurface(), fvMeshDistribute::findCouples(), polyBoundaryMesh::groupPatchIDs(), chemkinReader::initReactionKeywordTable(), HashSet< label, Hash< label > >::insert(), surfaceInterpolateFields::interpolateFields(), objectRegistry::lookupClass(), main(), Foam::MapConsistentSubMesh(), PatchTools::matchEdges(), edgeMesh::mergeEdges(), edgeMesh::mergePoints(), polyBoundaryMesh::neighbourEdges(), HashTable< Foam::autoPtr< Foam::interfaceCompositionModel > >::operator=(), boundaryMesh::patchify(), processorGAMGInterface::processorGAMGInterface(), functionObjectList::read(), wallBoundedStreamLine::read(), triSurface::readOBJ(), triSurface::readTRI(), HashTable< Foam::autoPtr< Foam::interfaceCompositionModel > >::resize(), tetDecomposer::setRefinement(), surfaceFeatures::surfaceFeatures(), boundaryCutter::updateMesh(), meshCutAndRemove::updateMesh(), meshCutter::updateMesh(), wallLayerCells::wallLayerCells(), meshReader::warnDuplicates(), and meshRefinement::zonify().

Here is the caller graph for this function:

◆ set() [2/2]

bool set ( const Key &  ,
const T newElmt 
)
inline

Assign a new hashedEntry, overwriting existing entries.

◆ erase() [1/5]

bool erase ( const iterator )

◆ erase() [2/5]

bool erase ( const Key &  )

Erase a hashedEntry specified by the given key.

◆ erase() [3/5]

label erase ( const UList< Key > &  )

Remove entries given by the listed keys from this HashTable.

Return the number of elements removed

◆ erase() [4/5]

label erase ( const HashTable< AnyType, Key, AnyHash > &  )

Remove entries given by the given keys from this HashTable.

Return the number of elements removed. The parameter HashTable needs the same type of key, but the type of values held and the hashing function are arbitrary.

◆ resize()

void resize ( const label  newSize)

◆ clear()

void clear ( )

Clear all entries from table.

Definition at line 473 of file HashTable.C.

Referenced by chemkinReader::addReaction(), decompositionMethod::calcCellCells(), cellToCellStencil::calcFaceCells(), cellToFaceStencil::calcFaceCells(), FECCellToFaceStencil::calcFaceStencil(), cellToFaceStencil::calcFaceStencil(), globalMeshData::calcSharedEdges(), isoSurfaceCell::calcSnappedPoint(), meshSurfacePartitioner::calculateCornersEdgesAndAddressing(), meshSurfaceCheckInvertedVertices::checkVertices(), HashPtrTable< ThermoType >::clear(), HashTable< Foam::autoPtr< Foam::interfaceCompositionModel > >::clearStorage(), slidingInterface::coupleInterface(), MGridGenGAMGAgglomeration::detectSharedFaces(), edgeCollapser::determineDuplicatePointsOnFace(), doCommand(), meshOctreeModifier::ensureCorrectRegularity(), meshOptimizer::findBadFaces(), Foam::polyMeshGenChecks::findBadFaces(), Foam::polyMeshGenChecks::findBadFacesRelaxed(), checkNonMappableCellConnections::findCells(), meshOptimizer::findLowQualityFaces(), Foam::polyMeshGenChecks::findLowQualityFaces(), checkBoundaryFacesSharingTwoEdges::findPoints(), Foam::polyMeshGenChecks::findWorstQualityFaces(), triSurfaceMesh::isSurfaceClosed(), meshOctreeModifier::markAdditionalLayers(), meshOctreeModifier::markAdditionalLayersOfFaceNeighbours(), HashTable< Foam::autoPtr< Foam::interfaceCompositionModel > >::operator=(), slidingInterface::projectPoints(), wallBoundedStreamLine::read(), globalPoints::receivePatchPoints(), meshOctreeCreator::refineBoxesNearDataBoxes(), tetDecomposer::setRefinement(), autoRefineDriver::shellRefine(), meshRefinement::splitFacesUndo(), surfaceFeatures::surfaceFeatures(), HashTable< Foam::autoPtr< Foam::interfaceCompositionModel > >::transfer(), and extendedUpwindCellToFaceStencil::transportStencil().

Here is the caller graph for this function:

◆ clearStorage()

void clearStorage ( )

Clear the table entries and the table itself.

Equivalent to clear() followed by resize(0)

Definition at line 497 of file HashTable.C.

◆ shrink()

void shrink ( )

Shrink the allocated table to approx. twice number of elements.

Definition at line 505 of file HashTable.C.

Referenced by main().

Here is the caller graph for this function:

◆ transfer()

void transfer ( HashTable< T, Key, Hash > &  ht)

Transfer the contents of the argument table into this table.

and annul the argument table.

Definition at line 518 of file HashTable.C.

Referenced by primitiveMesh::checkEdgeLength(), findCellsIntersectingSurface::findIntersectedCells(), meshOctreeAddressing::findUsedBoxes(), polyBoundaryMesh::matchGroups(), polyTopoChange::renumber(), motionSmootherAlgo::scaleMesh(), extendedEdgeMesh::transfer(), and updateCellSet().

Here is the caller graph for this function:

◆ xfer()

Foam::Xfer< Foam::HashTable< T, Key, Hash > > xfer ( )
inline

Transfer contents to the Xfer container.

Definition at line 102 of file HashTableI.H.

◆ operator[]() [1/2]

T& operator[] ( const Key &  )
inline

Find and return a hashedEntry.

◆ operator[]() [2/2]

const T& operator[] ( const Key &  ) const
inline

Find and return a hashedEntry.

◆ operator()()

T & operator() ( const Key &  key)
inline

Find and return a hashedEntry, create it null if not present.

Definition at line 143 of file HashTableI.H.

◆ operator=()

void operator= ( const HashTable< T, Key, Hash > &  rhs)

Assignment.

Definition at line 542 of file HashTable.C.

◆ operator==()

bool operator== ( const HashTable< T, Key, Hash > &  rhs) const

Equality. Hash tables are equal if the keys and values are equal.

Independent of table storage size and table order.

Definition at line 573 of file HashTable.C.

Referenced by HashTable< Foam::autoPtr< Foam::interfaceCompositionModel > >::operator!=().

Here is the caller graph for this function:

◆ operator!=()

bool operator!= ( const HashTable< T, Key, Hash > &  rhs) const

The opposite of the equality operation. Takes linear time.

Definition at line 599 of file HashTable.C.

◆ begin() [1/2]

Foam::HashTable< T, Key, Hash >::iterator begin ( )
inline

◆ cbegin()

Foam::HashTable< T, Key, Hash >::const_iterator cbegin ( ) const
inline

◆ begin() [2/2]

Foam::HashTable< T, Key, Hash >::const_iterator begin ( ) const
inline

const_iterator set to the beginning of the HashTable

Definition at line 520 of file HashTableI.H.

◆ erase() [5/5]

Foam::label erase ( const HashTable< AnyType, Key, AnyHash > &  rhs)

Definition at line 415 of file HashTable.C.

Friends And Related Function Documentation

◆ HashPtrTable

friend class HashPtrTable
friend

Declare friendship with the HashPtrTable class.

Definition at line 179 of file HashTable.H.

◆ iteratorBase

friend class iteratorBase
friend

Declare friendship with the iteratorBase.

Definition at line 186 of file HashTable.H.

◆ iterator

friend class iterator
friend

◆ const_iterator

friend class const_iterator
friend

◆ operator>>

Istream& operator>> ( Istream ,
HashTable< T, Key, Hash > &   
)
friend

◆ operator

Ostream& operator ( Ostream ,
const HashTable< T, Key, Hash > &   
)
friend

Field Documentation

◆ const_reference

const typedef T& const_reference

Type that can be used for storing into constant.

HashTable::value_type objects. This type is usually const HashTable::value_type&.

Definition at line 330 of file HashTable.H.

◆ nElmts_

label nElmts_
private

◆ tableSize_

label tableSize_
private

◆ table_

hashedEntry** table_
private

The documentation for this class was generated from the following files: