ATLAS Offline Software
Classes | Functions
NavigationTokenHash.h File Reference

Allow overriding the default hash function used within NavigationToken. More...

#include <functional>
Include dependency graph for NavigationTokenHash.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  NavigationTokenHash< CHILD >
 

Functions

std::size_t navigationHash (const void *p)
 Allow overriding the default hash function used within NavigationToken. More...
 

Detailed Description

Allow overriding the default hash function used within NavigationToken.

Author
scott snyder snyde.nosp@m.r@bn.nosp@m.l.gov
Date
Mar, 2011

Definition in file NavigationTokenHash.h.

Function Documentation

◆ navigationHash()

std::size_t navigationHash ( const void *  p)
inline

Allow overriding the default hash function used within NavigationToken.

NavigationToken relies on iterating over a hash table to define the order of the iteration. Since we use pointers as keys, and pick up the default C++ function for pointers, that means that the order of iteration may not be reproducible from run to run.

If this matters, you can define an alternate hash function that depends on the object contents, rather than on the pointer value. You can specify this as the HASH template argument to NavigationToken; or, to change the default for all uses of the type, you can add an override for navigationHash or a specialization for NavigationTokenHash.

Definition at line 39 of file NavigationTokenHash.h.

40 {
41  return std::hash<const void*>() (p);
42 }
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210