Teuchos::Hashtable< Key, Value > Class Template Reference

Templated hashtable class. More...

#include <Teuchos_Hashtable.hpp>

List of all members.

Public Member Functions

 Hashtable (int capacity=101, double rehashDensity=0.8)
 Create an empty Hashtable.
bool containsKey (const Key &key) const
 Check for the presence of a key.
const Value & get (const Key &key) const
 Get the value indexed by key.
void put (const Key &key, const Value &value)
 Put a new (key, value) pair in the table.
void remove (const Key &key)
 Remove from the table the element given by key.
int size () const
 Get the number of elements in the table.
void arrayify (Array< Key > &keys, Array< Value > &values) const
 Get lists of keys and values in Array form.
double avgDegeneracy () const
 Return the average degeneracy (average number of entries per hash code).
double density () const
 Return the density of the hashtable (num entries / capacity).
void setRehashDensity (double rehashDensity)
 Set the density at which to do a rehash.
std::string toString () const
 Write to a std::string.

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &os, const Hashtable< Key, Value > &h)
 Write Hashtable to a stream.


Detailed Description

template<class Key, class Value>
class Teuchos::Hashtable< Key, Value >

Templated hashtable class.

Author:
Kevin Long


Constructor & Destructor Documentation

template<class Key, class Value>
Teuchos::Hashtable< Key, Value >::Hashtable int  capacity = 101,
double  rehashDensity = 0.8
[inline]
 

Create an empty Hashtable.


Member Function Documentation

template<class Key, class Value>
bool Teuchos::Hashtable< Key, Value >::containsKey const Key &  key  )  const [inline]
 

Check for the presence of a key.

template<class Key, class Value>
const Value & Teuchos::Hashtable< Key, Value >::get const Key &  key  )  const [inline]
 

Get the value indexed by key.

template<class Key, class Value>
void Teuchos::Hashtable< Key, Value >::put const Key &  key,
const Value &  value
[inline]
 

Put a new (key, value) pair in the table.

template<class Key, class Value>
void Teuchos::Hashtable< Key, Value >::remove const Key &  key  )  [inline]
 

Remove from the table the element given by key.

template<class Key, class Value>
int Teuchos::Hashtable< Key, Value >::size  )  const [inline]
 

Get the number of elements in the table.

template<class Key, class Value>
void Teuchos::Hashtable< Key, Value >::arrayify Array< Key > &  keys,
Array< Value > &  values
const [inline]
 

Get lists of keys and values in Array form.

template<class Key, class Value>
double Teuchos::Hashtable< Key, Value >::avgDegeneracy  )  const [inline]
 

Return the average degeneracy (average number of entries per hash code).

template<class Key, class Value>
double Teuchos::Hashtable< Key, Value >::density  )  const [inline]
 

Return the density of the hashtable (num entries / capacity).

template<class Key, class Value>
void Teuchos::Hashtable< Key, Value >::setRehashDensity double  rehashDensity  )  [inline]
 

Set the density at which to do a rehash.

template<class Key, class Value>
std::string Teuchos::Hashtable< Key, Value >::toString  )  const [inline]
 

Write to a std::string.


Friends And Related Function Documentation

template<class Key, class Value>
std::ostream & operator<< std::ostream &  os,
const Hashtable< Key, Value > &  h
[related]
 

Write Hashtable to a stream.


The documentation for this class was generated from the following file:
Generated on Sun Nov 23 12:11:32 2008 for Teuchos - Trilinos Tools Package by  doxygen 1.3.9.1