hashVector< H, T > Class Template Reference

#include <hash_vector.hh>

List of all members.

Public Member Functions

 hashVector (size_t max, size_t(*f)(const H &))
 hashVector (size_t max, size_t(*f)(const H &), T &initialValue)
 hashVector (const hashVector< H, T > &v)
T & operator[] (const H &index)
const T & operator[] (const H &index) const

Private Attributes

size_t(* hashfun )(const H &)


Detailed Description

template<class H, class T>
class hashVector< H, T >

Definition at line 32 of file hash_vector.hh.


Constructor & Destructor Documentation

template<class H, class T>
hashVector< H, T >::hashVector ( size_t  max,
size_t(*)(const H &)  f 
) [inline]

Definition at line 54 of file hash_vector.hh.

00055     : vector<T>(max), hashfun(f)
00056 {
00057     // no further initialization
00058 }

template<class H, class T>
hashVector< H, T >::hashVector ( size_t  max,
size_t(*)(const H &)  f,
T &  initialValue 
) [inline]

Definition at line 63 of file hash_vector.hh.

00064     : vector<T>(max, initialValue), hashfun(f)
00065 {
00066     // no further initialization
00067 }

template<class H, class T>
hashVector< H, T >::hashVector ( const hashVector< H, T > &  v  )  [inline]

Definition at line 72 of file hash_vector.hh.

00073     : vector<T>(v), hashfun(v.hashfun)
00074 {
00075     // no further initialization
00076 }


Member Function Documentation

template<class H, class T>
const T & hashVector< H, T >::operator[] ( const H index  )  const [inline]

Definition at line 90 of file hash_vector.hh.

References hashVector< H, T >::hashfun, and delete_small_size::size.

00091 {
00092   // subscript a hash vector
00093   // hash the index value before indexing vector
00094   return vector<T>::operator[] ((*hashfun)(index) % size());
00095 }

template<class H, class T>
T & hashVector< H, T >::operator[] ( const H index  )  [inline]

Definition at line 81 of file hash_vector.hh.

References hashVector< H, T >::hashfun, and delete_small_size::size.

00082 {
00083   // subscript a hash vector
00084   // hash the index value before indexing vector
00085   return vector<T>::operator[] ((*hashfun)(index) % size());
00086 }


Member Data Documentation

template<class H, class T>
size_t(* hashVector< H, T >::hashfun)(const H &) [private]

Referenced by hashVector< H, T >::operator[]().


Generated on Tue Nov 29 23:19:39 2016 for BOSS_7.0.2 by  doxygen 1.4.7