FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

HashSet< Key, Hash > Class Template Reference

A HashTable with keys but without contents. More...

#include <OpenFOAM/HashSet.H>


Detailed Description

template<class Key = word, class Hash = string::hash>
class Foam::HashSet< Key, Hash >

A HashTable with keys but without contents.

Definition at line 58 of file HashSet.H.

Inheritance diagram for HashSet< Key, Hash >:
Collaboration diagram for HashSet< Key, Hash >:

List of all members.

Public Types

typedef HashTable< nil, Key,
Hash >::iterator  
iterator
typedef HashTable< nil, Key,
Hash >::const_iterator  
const_iterator

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.

Member Typedef Documentation

typedef HashTable<nil, Key, Hash>::iterator iterator

Reimplemented from HashTable< nil, Key, Hash >.

Definition at line 65 of file HashSet.H.

Reimplemented from HashTable< nil, Key, Hash >.

Definition at line 66 of file HashSet.H.


Constructor & Destructor Documentation

HashSet ( const label   size = 128  ) [inline]

Construct given initial size.

Definition at line 72 of file HashSet.H.

HashSet ( Istream &   is  ) [inline]

Construct from Istream.

Definition at line 78 of file HashSet.H.

HashSet ( const UList< Key > &   lst  ) [inline]

Construct from UList of Key.

Definition at line 84 of file HashSet.H.

HashSet ( const HashSet< Key, Hash > &   hs  ) [inline]

Construct as copy.

Definition at line 95 of file HashSet.H.

HashSet ( const Xfer< HashSet< Key, Hash > > &   hs  ) [inline]

Construct by transferring the parameter contents.

Definition at line 101 of file HashSet.H.

HashSet ( const Xfer< HashTable< nil, Key, Hash > > &   hs  ) [inline]

Construct by transferring the parameter contents.

Definition at line 107 of file HashSet.H.

HashSet ( const HashTable< AnyType, Key, AnyHash > &   h  )

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().


Member Function Documentation

bool insert ( const Key &   key  ) [inline]

Insert a new entry.

Definition at line 123 of file HashSet.H.

Referenced by meshRefinement::baffleAndSplitMesh(), cellToFaceStencil::calcFaceStencil(), primitiveMesh::checkCellDeterminant(), primitiveMeshGeometry::checkCellDeterminant(), polyMeshGeometry::checkCellDeterminant(), primitiveMesh::checkCellsZipUp(), primitiveMesh::checkCellVolumes(), primitiveMesh::checkClosedCells(), primitiveMesh::checkEdgeAlignment(), primitiveMesh::checkEdgeLength(), primitiveMesh::checkFaceAngles(), primitiveMeshGeometry::checkFaceAngles(), polyMeshGeometry::checkFaceAngles(), primitiveMeshGeometry::checkFaceArea(), polyMeshGeometry::checkFaceArea(), primitiveMesh::checkFaceAreas(), primitiveMeshGeometry::checkFaceDotProduct(), primitiveMesh::checkFaceFlatness(), primitiveMesh::checkFaceOrthogonality(), primitiveMesh::checkFacePyramids(), primitiveMeshGeometry::checkFacePyramids(), polyMeshGeometry::checkFacePyramids(), primitiveMesh::checkFaceSkewness(), primitiveMeshGeometry::checkFaceSkewness(), polyMeshGeometry::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(), cellToFaceStencil::insertFaceCells(), cellToCellStencil::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().

bool set ( const Key &   key  ) [inline]

Same as insert (cannot overwrite nil content)

Definition at line 129 of file HashSet.H.

bool operator[] ( const Key &   key  ) const [inline]

Return true if the entry exists, same as found()

Reimplemented from HashTable< nil, Key, Hash >.

Definition at line 58 of file HashSet.C.

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

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().

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

The opposite of the equality operation.

Definition at line 90 of file HashSet.C.

References Foam::operator==().

void operator|= ( const HashSet< Key, Hash > &   rhs  )

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+=().

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

Only retain entries found in both HashSets.

Definition at line 108 of file HashSet.C.

References HashTable< nil, Key, Hash >::found().

void operator^= ( const HashSet< Key, Hash > &   rhs  )

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().

void operator+= ( const HashSet< Key, Hash > &   rhs  ) [inline]

Add entries listed in the given HashSet to this HashSet.

Definition at line 158 of file HashSet.H.

void operator-= ( const HashSet< Key, Hash > &   rhs  )

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().


The documentation for this class was generated from the following files:
  • src/OpenFOAM/containers/HashTables/HashSet/HashSet.H
  • src/OpenFOAM/containers/HashTables/HashSet/HashSet.C