Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v28r2p1 (f1a77ff4)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
EventContextHash.h
Go to the documentation of this file.
1 #ifndef __EVENT_CONTEXT_HASH_H
2 #define __EVENT_CONTEXT_HASH_H
14  public:
15  size_t hash(const EventContext& ctx)const {
16  size_t en=ctx.evt();
17  size_t es=ctx.slot();
18  return en^(es+(en<<6)+(en>>2));
19  }
20  bool equal(const EventContext& a, const EventContext& b)const{
21  return hash(a)==hash(b);
22  }
23 
25  return hash(ctx);
26  }
27  bool operator()(const EventContext& ctx,const EventContext& ctxb)const{
28  return equal(ctx,ctxb);
29  }
30 };
31 
32 #endif
bool equal(const EventContext &a, const EventContext &b) const
ContextID_t slot() const
Definition: EventContext.h:41
This class represents an entry point to all the event specific data.
Definition: EventContext.h:25
ContextEvt_t evt() const
Definition: EventContext.h:40
bool operator()(const EventContext &ctx, const EventContext &ctxb) const
size_t hash(const EventContext &ctx) const
hash from EventContext so EvenContexts can be used as keys in unordered maps.
std::size_t operator()(const EventContext &ctx) const