| The Gaudi Framework v28r2-patches (bc4ad17a)

- 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 20 of file EventContextHash.h.

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

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

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

Definition at line 24 of file EventContextHash.h.

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

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

Definition at line 27 of file EventContextHash.h.

27 {
28 return equal(ctx,ctxb);
29 }
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