| The Gaudi Framework v30r0 (c919700c)

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

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Static Public Attributes | Private Attributes | List of all members
EventContext Class Reference

This class represents an entry point to all the event specific data. More...

`#include <GaudiKernel/EventContext.h>`

Collaboration diagram for EventContext:
[legend]

## Public Types
typedef size_t | ContextID_t
typedef size_t | ContextEvt_t

## Public Member Functions
| EventContext ()
| EventContext (const ContextEvt_t &e, const ContextID_t &s=INVALID_CONTEXT_ID)
ContextEvt_t | evt () const
ContextID_t | slot () const
bool | valid () const
const EventIDBase & | eventID () const
void | set (const ContextEvt_t &e=0, const ContextID_t &s=INVALID_CONTEXT_ID)
void | setEvt (const ContextEvt_t &e)
void | setSlot (const ContextID_t &s)
void | setValid (const bool &b=true)
void | setEventID (const EventIDBase &e)
template<typename T >
void | setExtension (const T &t)
template<typename T >
T * | getExtension ()
template<typename T >
const T * | getExtension () const
const std::type_info & | getExtensionType () const

## Static Public Attributes
static const ContextID_t | INVALID_CONTEXT_ID = std::numeric_limits<ContextID_t>::max()
static const ContextEvt_t | INVALID_CONTEXT_EVT = std::numeric_limits<ContextEvt_t>::max()

## Private Attributes
ContextEvt_t | m_evt_num {INVALID_CONTEXT_EVT}
ContextID_t | m_evt_slot {INVALID_CONTEXT_ID}
bool | m_valid {false}
boost::any | m_extension
EventIDBase | m_eid {}

## Detailed Description

This class represents an entry point to all the event specific data.

It is needed to make the algorithm "aware" of the event it is operating on. This was not needed in the serial version of Gaudi where the assumption of 1-event-at-the-time processing was implicit.

This class has nothing to do with the AlgContextSvc or the Context of the EvtSelector!

Author
  Danilo Piparo, Charles Leggett

Date
  2012

Definition at line 24 of file EventContext.h.

## Member Typedef Documentation

typedef size_t EventContext::ContextEvt_t

Definition at line 28 of file EventContext.h.

typedef size_t EventContext::ContextID_t

Definition at line 27 of file EventContext.h.

## Constructor & Destructor Documentation

EventContext::EventContext | ( |  | ) |
| inline

Definition at line 33 of file EventContext.h.

33 {};

EventContext::EventContext | ( | const ContextEvt_t & | e,
|  | const ContextID_t & | s = `INVALID_CONTEXT_ID`
| ) |  |
| inline

Definition at line 34 of file EventContext.h.

34 : m_evt_num( e ), m_evt_slot( s )
35 {
36 m_valid = ( e == INVALID_CONTEXT_EVT || s == INVALID_CONTEXT_ID ) ? false : true;
37 }
EventContext::m_valid
bool m_valid
Definition: EventContext.h:97
EventContext::m_evt_slot
ContextID_t m_evt_slot
Definition: EventContext.h:96
EventContext::INVALID_CONTEXT_EVT
static const ContextEvt_t INVALID_CONTEXT_EVT
Definition: EventContext.h:31
EventContext::INVALID_CONTEXT_ID
static const ContextID_t INVALID_CONTEXT_ID
Definition: EventContext.h:30
EventContext::m_evt_num
ContextEvt_t m_evt_num
Definition: EventContext.h:95
gaudirun.s
string s
Definition: gaudirun.py:253

## Member Function Documentation

const EventIDBase& EventContext::eventID | ( |  | ) | const
| inline

Definition at line 42 of file EventContext.h.

42 { return m_eid; }
EventContext::m_eid
EventIDBase m_eid
Definition: EventContext.h:101

ContextEvt_t EventContext::evt | ( |  | ) | const
| inline

Definition at line 39 of file EventContext.h.

39 { return m_evt_num; }
EventContext::m_evt_num
ContextEvt_t m_evt_num
Definition: EventContext.h:95
template<typename T >

T* EventContext::getExtension | ( |  | ) |
| inline

Definition at line 81 of file EventContext.h.

82 {
83 return boost::any_cast<T>( &m_extension );
84 }
EventContext::m_extension
boost::any m_extension
Definition: EventContext.h:99
template<typename T >

const T* EventContext::getExtension | ( |  | ) | const
| inline

Definition at line 87 of file EventContext.h.

88 {
89 return boost::any_cast<T>( &m_extension );
90 }
EventContext::m_extension
boost::any m_extension
Definition: EventContext.h:99

const std::type_info& EventContext::getExtensionType | ( |  | ) | const
| inline

Definition at line 92 of file EventContext.h.

92 { return m_extension.type(); }
EventContext::m_extension
boost::any m_extension
Definition: EventContext.h:99

void EventContext::set | ( | const ContextEvt_t & | e = `0`,
|  | const ContextID_t & | s = `INVALID_CONTEXT_ID`
| ) |  |
| inline

Definition at line 44 of file EventContext.h.

45 {
46 m_valid = ( e == INVALID_CONTEXT_EVT || s == INVALID_CONTEXT_ID ) ? false : true;
47 m_evt_num = e;
48 m_evt_slot = s;
49 }
EventContext::m_valid
bool m_valid
Definition: EventContext.h:97
EventContext::m_evt_slot
ContextID_t m_evt_slot
Definition: EventContext.h:96
EventContext::INVALID_CONTEXT_EVT
static const ContextEvt_t INVALID_CONTEXT_EVT
Definition: EventContext.h:31
EventContext::INVALID_CONTEXT_ID
static const ContextID_t INVALID_CONTEXT_ID
Definition: EventContext.h:30
EventContext::m_evt_num
ContextEvt_t m_evt_num
Definition: EventContext.h:95
gaudirun.s
string s
Definition: gaudirun.py:253

void EventContext::setEventID | ( | const EventIDBase & | e | ) |
| inline

Definition at line 72 of file EventContext.h.

72 { m_eid = e; }
EventContext::m_eid
EventIDBase m_eid
Definition: EventContext.h:101

void EventContext::setEvt | ( | const ContextEvt_t & | e | ) |
| inline

Definition at line 51 of file EventContext.h.

52 {
53 if ( e == INVALID_CONTEXT_EVT ) setValid( false );
54 m_evt_num = e;
55 }
EventContext::INVALID_CONTEXT_EVT
static const ContextEvt_t INVALID_CONTEXT_EVT
Definition: EventContext.h:31
EventContext::m_evt_num
ContextEvt_t m_evt_num
Definition: EventContext.h:95
EventContext::setValid
void setValid(const bool &b=true)
Definition: EventContext.h:63
template<typename T >

void EventContext::setExtension | ( | const T & | t | ) |
| inline

Definition at line 75 of file EventContext.h.

76 {
77 m_extension = t;
78 }
EventContext::m_extension
boost::any m_extension
Definition: EventContext.h:99

void EventContext::setSlot | ( | const ContextID_t & | s | ) |
| inline

Definition at line 57 of file EventContext.h.

58 {
59 if ( s == INVALID_CONTEXT_ID ) setValid( false );
60 m_evt_slot = s;
61 }
EventContext::m_evt_slot
ContextID_t m_evt_slot
Definition: EventContext.h:96
EventContext::INVALID_CONTEXT_ID
static const ContextID_t INVALID_CONTEXT_ID
Definition: EventContext.h:30
gaudirun.s
string s
Definition: gaudirun.py:253
EventContext::setValid
void setValid(const bool &b=true)
Definition: EventContext.h:63

void EventContext::setValid | ( | const bool & | b = `true` | ) |
| inline

Definition at line 63 of file EventContext.h.

64 {
65 m_valid = b;
66 if ( !m_valid ) {
67 m_evt_slot = INVALID_CONTEXT_ID;
68 m_evt_num = INVALID_CONTEXT_EVT;
69 }
70 }
EventContext::m_valid
bool m_valid
Definition: EventContext.h:97
EventContext::m_evt_slot
ContextID_t m_evt_slot
Definition: EventContext.h:96
EventContext::INVALID_CONTEXT_EVT
static const ContextEvt_t INVALID_CONTEXT_EVT
Definition: EventContext.h:31
EventContext::INVALID_CONTEXT_ID
static const ContextID_t INVALID_CONTEXT_ID
Definition: EventContext.h:30
EventContext::m_evt_num
ContextEvt_t m_evt_num
Definition: EventContext.h:95

ContextID_t EventContext::slot | ( |  | ) | const
| inline

Definition at line 40 of file EventContext.h.

40 { return m_evt_slot; }
EventContext::m_evt_slot
ContextID_t m_evt_slot
Definition: EventContext.h:96

bool EventContext::valid | ( |  | ) | const
| inline

Definition at line 41 of file EventContext.h.

41 { return m_valid; }
EventContext::m_valid
bool m_valid
Definition: EventContext.h:97

## Member Data Documentation

const ContextEvt_t EventContext::INVALID_CONTEXT_EVT = std::numeric_limits<ContextEvt_t>::max()
| static

Definition at line 31 of file EventContext.h.

const ContextID_t EventContext::INVALID_CONTEXT_ID = std::numeric_limits<ContextID_t>::max()
| static

Definition at line 30 of file EventContext.h.

EventIDBase EventContext::m_eid {}
| private

Definition at line 101 of file EventContext.h.

ContextEvt_t EventContext::m_evt_num {INVALID_CONTEXT_EVT}
| private

Definition at line 95 of file EventContext.h.

ContextID_t EventContext::m_evt_slot {INVALID_CONTEXT_ID}
| private

Definition at line 96 of file EventContext.h.

boost::any EventContext::m_extension
| private

Definition at line 99 of file EventContext.h.

bool EventContext::m_valid {false}
| private

Definition at line 97 of file EventContext.h.

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

- GaudiKernel/GaudiKernel/EventContext.h