The Gaudi Framework  master (37c0b60a)
EventContextHash Class Reference

#include </builds/gaudi/Gaudi/GaudiKernel/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 23 of file EventContextHash.h.

Member Function Documentation

◆ equal()

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

Definition at line 30 of file EventContextHash.h.

30 { return hash( a ) == hash( b ); }

◆ hash()

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

Definition at line 25 of file EventContextHash.h.

25  {
26  size_t en = ctx.evt();
27  size_t es = ctx.slot();
28  return en ^ ( es + ( en << 6 ) + ( en >> 2 ) );
29  }

◆ operator()() [1/2]

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

Definition at line 32 of file EventContextHash.h.

32 { return hash( ctx ); }

◆ operator()() [2/2]

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

Definition at line 33 of file EventContextHash.h.

33 { return equal( ctx, ctxb ); }

The documentation for this class was generated from the following file:
GaudiPython.Pythonizations.ctx
ctx
Definition: Pythonizations.py:578
EventContextHash::hash
size_t hash(const EventContext &ctx) const
Definition: EventContextHash.h:25
EventContextHash::equal
bool equal(const EventContext &a, const EventContext &b) const
Definition: EventContextHash.h:30