OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

HashSet< Key, Hash > Class Template Reference

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

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 >
 HashSet (const HashTable< AnyType, Key, Hash > &)
 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.

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 52 of file HashSet.H.


Member Typedef Documentation

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

Reimplemented from HashTable< nil, Key, Hash >.

Definition at line 59 of file HashSet.H.

Reimplemented from HashTable< nil, Key, Hash >.

Definition at line 60 of file HashSet.H.


Constructor & Destructor Documentation

HashSet ( const label  size = 128  )  [inline]

Construct given initial size.

Definition at line 66 of file HashSet.H.

HashSet ( Istream &  is  )  [inline]

Construct from Istream.

Definition at line 72 of file HashSet.H.

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

Construct from UList of Key.

Definition at line 78 of file HashSet.H.

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

Construct as copy.

Definition at line 89 of file HashSet.H.

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

Construct by transferring the parameter contents.

Definition at line 95 of file HashSet.H.

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

Construct by transferring the parameter contents.

Definition at line 101 of file HashSet.H.

HashSet ( const HashTable< AnyType, Key, Hash > &  h  )  [inline]

Construct from the keys of another HashTable,.

the type of values held is arbitrary.

Definition at line 27 of file HashSet.C.

References HashTable< T, Key, Hash >::cbegin(), and HashTable< T, Key, Hash >::cend().

Here is the call graph for this function:


Member Function Documentation

bool insert ( const Key &  key  )  [inline]

bool set ( const Key &  key  )  [inline]

Same as insert (cannot overwrite nil content).

Definition at line 124 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 46 of file HashSet.C.

References HashSet< Key, Hash >::insert().

Here is the call graph for this function:

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

Equality. Two hashtables are equal when their contents are equal.

Independent of table size or order.

Definition at line 53 of file HashSet.C.

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

Referenced by HashSet< Key, Hash >::operator|=().

Here is the call graph for this function:

Here is the caller graph for this function:

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

The opposite of the equality operation.

Definition at line 78 of file HashSet.C.

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

Combine entries from HashSets.

Definition at line 85 of file HashSet.C.

References HashSet< Key, Hash >::operator==().

Here is the call graph for this function:

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

Only retain entries found in both HashSets.

Definition at line 96 of file HashSet.C.

References HashSet< Key, Hash >::insert().

Here is the call graph for this function:

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

Only retain unique entries (xor).

Definition at line 110 of file HashSet.C.

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

Here is the call graph for this function:

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

Add entries listed in the given HashSet to this HashSet.

Definition at line 154 of file HashSet.H.

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

Remove entries listed in the given HashSet from this HashSet.

Definition at line 129 of file HashSet.C.

References HashSet< Key, Hash >::insert().

Here is the call graph for this function:


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
Copyright © 2000-2009 OpenCFD Ltd