forked from cms-patatrack/pixeltrack-standalone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EDGetToken.h
85 lines (62 loc) · 2.3 KB
/
EDGetToken.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#ifndef FWCore_Utilities_EDGetToken_h
#define FWCore_Utilities_EDGetToken_h
// -*- C++ -*-
//
// Package: FWCore/Utilities
// Class : EDGetToken
//
/**\class EDGetToken EDGetToken.h "FWCore/Utilities/interface/EDGetToken.h"
Description: A Token used to get data from the EDM
Usage:
A EDGetToken is created by calls to 'consumes' or 'mayConsume' from an EDM module.
The EDGetToken can then be used to quickly retrieve data from the edm::Event, edm::LuminosityBlock or edm::Run.
The templated form, EDGetTokenT<T>, is the same as EDGetToken except when used to get data the framework
will skip checking that the type being requested matches the type specified during the 'consumes' or 'mayConsume' call.
*/
//
// Original Author: Chris Jones
// Created: Wed, 03 Apr 2013 17:54:11 GMT
//
// system include files
// user include files
// forward declarations
namespace edm {
template <typename T>
class EDGetTokenT;
class ProductRegistry;
class EDGetToken {
friend class ProductRegistry;
public:
EDGetToken() : m_value{s_uninitializedValue} {}
template <typename T>
EDGetToken(EDGetTokenT<T> iOther) : m_value{iOther.m_value} {}
// ---------- const member functions ---------------------
unsigned int index() const { return m_value; }
bool isUninitialized() const { return m_value == s_uninitializedValue; }
private:
//for testing
friend class TestEDGetToken;
static const unsigned int s_uninitializedValue = 0xFFFFFFFF;
explicit EDGetToken(unsigned int iValue) : m_value(iValue) {}
// ---------- member data --------------------------------
unsigned int m_value;
};
template <typename T>
class EDGetTokenT {
friend class ProductRegistry;
friend class EDGetToken;
public:
EDGetTokenT() : m_value{s_uninitializedValue} {}
// ---------- const member functions ---------------------
unsigned int index() const { return m_value; }
bool isUninitialized() const { return m_value == s_uninitializedValue; }
private:
//for testing
friend class TestEDGetToken;
static const unsigned int s_uninitializedValue = 0xFFFFFFFF;
explicit EDGetTokenT(unsigned int iValue) : m_value(iValue) {}
// ---------- member data --------------------------------
unsigned int m_value;
};
} // namespace edm
#endif