| # Gaudi Framework, version v21r9 |

Home |  | Generated: 3 May 2010

# GaudiUtils::GenericHash< T > Struct Template Reference

Generic hash implementation (for easy migration to the new Hash class). More...

`#include <Hash.h>`

Inheritance diagram for GaudiUtils::GenericHash< T >:

[legend]
Collaboration diagram for GaudiUtils::GenericHash< T >:

[legend]

List of all members.

## Public Member Functions
std::size_t | operator() (const T &key) const
| the generic hash function

## Detailed Description

### template<class T>
struct GaudiUtils::GenericHash< T >

Generic hash implementation (for easy migration to the new Hash class).

Definition at line 30 of file Hash.h.

## Member Function Documentation

template<class T>

std::size_t GaudiUtils::GenericHash< T >::operator() | ( | const T & | key | ) | const`[inline]`

the generic hash function

Definition at line 34 of file Hash.h.

    00034                                                        {
    00035       std::size_t res = 0 ;
    00036       std::size_t len = sizeof(T) ;
    00037       const char* p = reinterpret_cast<const char*>( &key );
    00038       while( len-- ) { res = ( res << 1 ) ^ *p; ++p; }
    00039       return res;
    00040     }

The documentation for this struct was generated from the following file:

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v21r9/GaudiKernel/GaudiKernel/Hash.h