| The Gaudi Framework v29r1 (5cd95fa2)

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

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

Public Member Functions | List of all members
EventContextHash Class Reference

hash from EventContext so EvenContexts can be used as keys in unordered maps. More...

`#include <GaudiKernel/EventContextHash.h>`

## Public Member Functions
size_t | hash (const EventContext &ctx) const
bool | equal (const EventContext &a, const EventContext &b) const
std::size_t | operator() (const EventContext &ctx) const
bool | operator() (const EventContext &ctx, const EventContext &ctxb) const

## Detailed Description

hash from EventContext so EvenContexts can be used as keys in unordered maps.

Hash is crated by combining event number and event slot using the algorithm from boost::hash_combine()

Author
  Sami Kama

Definition at line 13 of file EventContextHash.h.

## Member Function Documentation

bool EventContextHash::equal | ( | const EventContext & | a,
|  | const EventContext & | b
| ) |  | const
| inline

Definition at line 22 of file EventContextHash.h.

22 { return hash( a ) == hash( b ); }
EventContextHash::hash
size_t hash(const EventContext &ctx) const
Definition: EventContextHash.h:16

size_t EventContextHash::hash | ( | const EventContext & | ctx | ) | const
| inline

Definition at line 16 of file EventContextHash.h.

17 {
18 size_t en = ctx.evt();
19 size_t es = ctx.slot();
20 return en ^ ( es + ( en << 6 ) + ( en >> 2 ) );
21 }
EventContext::slot
ContextID_t slot() const
Definition: EventContext.h:40
EventContext::evt
ContextEvt_t evt() const
Definition: EventContext.h:39

std::size_t EventContextHash::operator() | ( | const EventContext & | ctx | ) | const
| inline

Definition at line 24 of file EventContextHash.h.

24 { return hash( ctx ); }
EventContextHash::hash
size_t hash(const EventContext &ctx) const
Definition: EventContextHash.h:16

bool EventContextHash::operator() | ( | const EventContext & | ctx,
|  | const EventContext & | ctxb
| ) |  | const
| inline

Definition at line 25 of file EventContextHash.h.

25 { return equal( ctx, ctxb ); }
EventContextHash::equal
bool equal(const EventContext &a, const EventContext &b) const
Definition: EventContextHash.h:22

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

- GaudiKernel/GaudiKernel/EventContextHash.h