| The Gaudi Framework v30r0 (c919700c)

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

- File List
- File Members

EventContextHash.h
Go to the documentation of this file.
1 #ifndef __EVENT_CONTEXT_HASH_H
2 #define __EVENT_CONTEXT_HASH_H
3 #include "GaudiKernel/EventContext.h"
13 class EventContextHash
14 {
15 public:
16 size_t hash( const EventContext& ctx ) const
17 {
18 size_t en = ctx.evt();
19 size_t es = ctx.slot();
20 return en ^ ( es + ( en << 6 ) + ( en >> 2 ) );
21 }
22 bool equal( const EventContext& a, const EventContext& b ) const { return hash( a ) == hash( b ); }
23
24 std::size_t operator()( const EventContext& ctx ) const { return hash( ctx ); }
25 bool operator()( const EventContext& ctx, const EventContext& ctxb ) const { return equal( ctx, ctxb ); }
26 };
27
28 #endif
EventContextHash::equal
bool equal(const EventContext &a, const EventContext &b) const
Definition: EventContextHash.h:22
EventContext::slot
ContextID_t slot() const
Definition: EventContext.h:40
EventContext.h
std::size_t
EventContext
This class represents an entry point to all the event specific data.
Definition: EventContext.h:24
EventContext::evt
ContextEvt_t evt() const
Definition: EventContext.h:39
EventContextHash::operator()
bool operator()(const EventContext &ctx, const EventContext &ctxb) const
Definition: EventContextHash.h:25
EventContextHash::hash
size_t hash(const EventContext &ctx) const
Definition: EventContextHash.h:16
EventContextHash
hash from EventContext so EvenContexts can be used as keys in unordered maps.
Definition: EventContextHash.h:13
EventContextHash::operator()
std::size_t operator()(const EventContext &ctx) const
Definition: EventContextHash.h:24