OpenFOAM logo
Open Source CFD Toolkit

StaticHashTable Class Template Reference

Collaboration diagram for StaticHashTable:

Collaboration graph
[legend]
List of all members.

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


Public Types

typedef Iterator< T &, StaticHashTable<
T, Key, Hash > & > 
iterator
typedef Iterator< const T &,
const StaticHashTable< T,
Key, Hash > & > 
const_iterator
typedef T value_type
 Type of values the StaticHashTable contains.
typedef T & reference
 Type that can be used for storing into StaticHashTable::value_type.
typedef const T & const_reference
 Type that can be used for storing into constant.
typedef label size_type
 The type that can represent the size of a StaticHashTable.

Public Member Functions

 StaticHashTable (const label size)
 Construct given initial table size.
 StaticHashTable (Istream &, const label size)
 Construct from Istream.
 StaticHashTable (const StaticHashTable< T, Key, Hash > &)
 Construct as copy.
 ~StaticHashTable ()
label size () const
 Return number of elements in table.
bool found (const Key &key) const
 Return true if hashedEntry is found in table.
iterator find (const Key &key)
 Find and return an iterator set at the hashedEntry.
const_iterator find (const Key &key) const
 Find and return an const_iterator set at the hashedEntry.
List< Key > toc () const
 Return the table of contents.
bool insert (const Key &key, const T &newElmt)
 Insert a new hashedEntry.
bool erase (const iterator &it)
 Erase an hashedEntry specified by given iterator.
bool erase (const Key &key)
 Erase an hashedEntry specified by given key if in table.
void resize (const label newSize)
 Resize the hash table for efficiency.
void clear ()
 Clear all entries from table.
void transfer (StaticHashTable< T, Key, Hash > &)
 Transfer the contents of the argument table into this table.
T & operator[] (const Key &key)
 Find and return an hashedEntry.
const T & operator[] (const Key &key) const
 Find and return an hashedEntry.
void operator= (const StaticHashTable< T, Key, Hash > &)
 Assignment.
iterator begin ()
 iterator set to the begining of the StaticHashTable
const iteratorend ()
 iterator set to beyond the end of the StaticHashTable
const_iterator begin () const
 const_iterator set to the begining of the StaticHashTable
const const_iteratorend () const
 const_iterator set to beyond the end of the StaticHashTable

Friends

class Iterator< T&, StaticHashTable<T, Key, Hash>& >
class Iterator< const T&, const StaticHashTable<T, Key, Hash>& >
Istreamoperator>> (Istream &, StaticHashTable< T, Key, Hash > &)
Ostreamoperator (Ostream &, const StaticHashTable< T, Key, Hash > &)

Member Typedef Documentation

typedef Iterator< const T&, const StaticHashTable<T, Key, Hash>& > const_iterator
 

Definition at line 125 of file StaticHashTable.H.

Referenced by StaticHashTable::begin(), StaticHashTable::end(), StaticHashTable::Iterator::operator!=(), and StaticHashTable::Iterator::operator==().

typedef const T& const_reference
 

Type that can be used for storing into constant.

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

Definition at line 238 of file StaticHashTable.H.

typedef Iterator< T&, StaticHashTable<T, Key, Hash>& > iterator
 

Definition at line 119 of file StaticHashTable.H.

Referenced by StaticHashTable::begin(), StaticHashTable::Iterator::key(), StaticHashTable::Iterator::operator=(), StaticHashTable::Iterator::operator==(), and StaticHashTable::size().

typedef T& reference
 

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

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

Definition at line 231 of file StaticHashTable.H.

typedef label size_type
 

The type that can represent the size of a StaticHashTable.

Definition at line 241 of file StaticHashTable.H.

typedef T value_type
 

Type of values the StaticHashTable contains.

Definition at line 225 of file StaticHashTable.H.


Constructor & Destructor Documentation

StaticHashTable const label  size  ) 
 

Construct given initial table size.

StaticHashTable Istream ,
const label  size
 

Construct from Istream.

StaticHashTable const StaticHashTable< T, Key, Hash > &   ) 
 

Construct as copy.

~StaticHashTable  ) 
 


Member Function Documentation

StaticHashTable< T, Key, Hash >::const_iterator begin  )  const [inline]
 

const_iterator set to the begining of the StaticHashTable

Definition at line 296 of file StaticHashTableI.H.

References StaticHashTable::const_iterator.

StaticHashTable< T, Key, Hash >::iterator begin  )  [inline]
 

iterator set to the begining of the StaticHashTable

Definition at line 264 of file StaticHashTableI.H.

References StaticHashTable::iterator.

void clear  ) 
 

Clear all entries from table.

const StaticHashTable< T, Key, Hash >::const_iterator & end  )  const [inline]
 

const_iterator set to beyond the end of the StaticHashTable

Definition at line 320 of file StaticHashTableI.H.

const StaticHashTable< T, Key, Hash >::iterator & end  )  [inline]
 

iterator set to beyond the end of the StaticHashTable

Definition at line 288 of file StaticHashTableI.H.

References StaticHashTable::const_iterator, and forAll.

Referenced by StaticHashTable::size().

bool erase const Key &  key  ) 
 

Erase an hashedEntry specified by given key if in table.

bool erase const iterator it  ) 
 

Erase an hashedEntry specified by given iterator.

const_iterator find const Key &  key  )  const
 

Find and return an const_iterator set at the hashedEntry.

If not found iterator = end()

iterator find const Key &  key  ) 
 

Find and return an iterator set at the hashedEntry.

If not found iterator = end()

Referenced by StaticHashTable::size().

bool found const Key &  key  )  const
 

Return true if hashedEntry is found in table.

bool insert const Key &  key,
const T &  newElmt
 

Insert a new hashedEntry.

void operator= const StaticHashTable< T, Key, Hash > &   ) 
 

Assignment.

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

Find and return an hashedEntry.

Definition at line 77 of file StaticHashTableI.H.

References Foam::exit(), Foam::FatalError, FatalErrorIn, and StaticHashTable::toc().

Here is the call graph for this function:

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

Find and return an hashedEntry.

Definition at line 61 of file StaticHashTableI.H.

References Foam::exit(), Foam::FatalError, FatalErrorIn, and StaticHashTable::toc().

Here is the call graph for this function:

void resize const label  newSize  ) 
 

Resize the hash table for efficiency.

label size  )  const [inline]
 

Return number of elements in table.

Definition at line 52 of file StaticHashTableI.H.

References StaticHashTable::end(), StaticHashTable::find(), StaticHashTable::iterator, and Foam::T().

Here is the call graph for this function:

List<Key> toc  )  const
 

Return the table of contents.

Referenced by StaticHashTable::operator[]().

void transfer StaticHashTable< T, Key, Hash > &   ) 
 

Transfer the contents of the argument table into this table.

and annull the argument table.


Friends And Related Function Documentation

friend class Iterator< const T&, const StaticHashTable<T, Key, Hash>& > [friend]
 

Definition at line 140 of file StaticHashTable.H.

friend class Iterator< T&, StaticHashTable<T, Key, Hash>& > [friend]
 

Definition at line 134 of file StaticHashTable.H.

Ostream& operator Ostream ,
const StaticHashTable< T, Key, Hash > & 
[friend]
 

Istream& operator>> Istream ,
StaticHashTable< T, Key, Hash > & 
[friend]
 


The documentation for this class was generated from the following files:
For further information go to www.openfoam.org