| The Gaudi Framework v32r1 (f65d50dc)

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

## ◆ equal()

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

Definition at line 20 of file EventContextHash.h.

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

## ◆ hash()

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

Definition at line 15 of file EventContextHash.h.

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

## ◆ operator()() [1/2]

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

Definition at line 22 of file EventContextHash.h.

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

## ◆ operator()() [2/2]

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

Definition at line 23 of file EventContextHash.h.

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

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

- GaudiKernel/GaudiKernel/EventContextHash.h