| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | List of all members
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]

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

## Additional Inherited Members
Public Types inherited from std::unary_function< T, std::size_t >
typedef T | argument_type
typedef std::size_t | result_type

## 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.

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

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

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