forked from cms-patatrack/pixeltrack-standalone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEDPutToken.h
89 lines (64 loc) · 2.35 KB
/
EDPutToken.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
86
87
88
89
#ifndef FWCore_Utilities_EDPutToken_h
#define FWCore_Utilities_EDPutToken_h
// -*- C++ -*-
//
// Package: FWCore/Utilities
// Class : EDPutToken
//
/**\class EDPutToken EDPutToken.h "FWCore/Utilities/interface/EDPutToken.h"
Description: A Token used to put data into the EDM
Usage:
A EDPutToken is created by calls to 'produces'from an EDProducer or EDFilter.
The EDPutToken can then be used to quickly put data into the edm::Event, edm::LuminosityBlock or edm::Run.
The templated form, EDPutTokenT<T>, is the same as EDPutToken except when used to get data the framework
will skip checking that the type being requested matches the type specified during the 'produces'' call.
*/
//
// Original Author: Chris Jones
// Created: Mon, 18 Sep 2017 17:54:11 GMT
//
// system include files
// user include files
// forward declarations
namespace edm {
template <typename T>
class EDPutTokenT;
class ProductRegistry;
class EDPutToken {
friend class ProductRegistry;
public:
using value_type = unsigned int;
EDPutToken() : m_value{s_uninitializedValue} {}
template <typename T>
EDPutToken(EDPutTokenT<T> iOther) : m_value{iOther.m_value} {}
// ---------- const member functions ---------------------
value_type index() const { return m_value; }
bool isUninitialized() const { return m_value == s_uninitializedValue; }
private:
//for testing
friend class TestEDPutToken;
static const unsigned int s_uninitializedValue = 0xFFFFFFFF;
explicit EDPutToken(unsigned int iValue) : m_value(iValue) {}
// ---------- member data --------------------------------
value_type m_value;
};
template <typename T>
class EDPutTokenT {
friend class ProductRegistry;
friend class EDPutToken;
public:
using value_type = EDPutToken::value_type;
EDPutTokenT() : m_value{s_uninitializedValue} {}
// ---------- const member functions ---------------------
value_type index() const { return m_value; }
bool isUninitialized() const { return m_value == s_uninitializedValue; }
private:
//for testing
friend class TestEDPutToken;
static const unsigned int s_uninitializedValue = 0xFFFFFFFF;
explicit EDPutTokenT(unsigned int iValue) : m_value(iValue) {}
// ---------- member data --------------------------------
value_type m_value;
};
} // namespace edm
#endif