@@ -8,45 +8,23 @@ namespace edm {
88 const std::string InputTag::kCurrentProcess (" @currentProcess" );
99 static std::string const separator (" :" );
1010
11- InputTag::InputTag ()
12- : label_(),
13- instance_ (),
14- process_(),
15- typeID_(),
16- productRegistry_(nullptr ),
17- index_(ProductResolverIndexInvalid),
18- branchType_(NumBranchTypes),
19- skipCurrentProcess_(false ) {}
11+ InputTag::InputTag () : label_(), instance_(), process_(), token_(), skipCurrentProcess_(false ) {}
2012
2113 InputTag::InputTag (std::string const & label, std::string const & instance, std::string const & processName)
2214 : label_(label),
2315 instance_ (instance),
2416 process_(processName),
25- typeID_(),
26- productRegistry_(nullptr ),
27- index_(ProductResolverIndexInvalid),
28- branchType_(NumBranchTypes),
17+ token_(),
2918 skipCurrentProcess_(calcSkipCurrentProcess()) {}
3019
3120 InputTag::InputTag (char const * label, char const * instance, char const * processName)
3221 : label_(label),
3322 instance_(instance),
3423 process_(processName),
35- typeID_(),
36- productRegistry_(nullptr ),
37- index_(ProductResolverIndexInvalid),
38- branchType_(NumBranchTypes),
24+ token_(),
3925 skipCurrentProcess_(calcSkipCurrentProcess()) {}
4026
41- InputTag::InputTag (std::string const & s)
42- : label_(),
43- instance_(),
44- process_(),
45- typeID_(),
46- productRegistry_(nullptr ),
47- index_(ProductResolverIndexInvalid),
48- branchType_(NumBranchTypes),
49- skipCurrentProcess_(false ) {
27+ InputTag::InputTag (std::string const & s) : label_(), instance_(), process_(), token_(), skipCurrentProcess_(false ) {
5028 // string is delimited by colons
5129 std::vector<std::string> tokens = tokenize (s, separator);
5230 size_t nwords = tokens.size ();
@@ -68,57 +46,23 @@ namespace edm {
6846 : label_(other.label()),
6947 instance_ (other.instance()),
7048 process_(other.process()),
71- typeID_(),
72- productRegistry_(nullptr ),
73- index_(ProductResolverIndexInvalid),
74- branchType_(NumBranchTypes),
75- skipCurrentProcess_(other.willSkipCurrentProcess()) {
76- ProductResolverIndex otherIndex = other.index_ .load ();
77- if (otherIndex < ProductResolverIndexInitializing) {
78- branchType_ = other.branchType_ ;
79- typeID_ = other.typeID_ ;
80- productRegistry_ = other.productRegistry_ ;
81- index_.store (otherIndex);
82- }
83- }
49+ token_(other.token_.load()),
50+ skipCurrentProcess_(other.willSkipCurrentProcess()) {}
8451
8552 InputTag::InputTag (InputTag&& other)
8653 : label_(std::move(other.label_)),
8754 instance_(std::move(other.instance_)),
8855 process_(std::move(other.process_)),
89- typeID_(),
90- productRegistry_(nullptr ),
91- index_(ProductResolverIndexInvalid),
92- branchType_(NumBranchTypes),
93- skipCurrentProcess_(other.willSkipCurrentProcess()) {
94- ProductResolverIndex otherIndex = other.index_ .load ();
95- if (otherIndex < ProductResolverIndexInitializing) {
96- branchType_ = other.branchType_ ;
97- typeID_ = other.typeID_ ;
98- productRegistry_ = other.productRegistry_ ;
99- index_.store (otherIndex);
100- }
101- }
56+ token_(other.token_.load()),
57+ skipCurrentProcess_(other.willSkipCurrentProcess()) {}
10258
10359 InputTag& InputTag::operator =(InputTag const & other) {
10460 if (this != &other) {
10561 label_ = other.label_ ;
10662 instance_ = other.instance_ ;
10763 process_ = other.process_ ;
10864 skipCurrentProcess_ = other.skipCurrentProcess_ ;
109-
110- ProductResolverIndex otherIndex = other.index_ .load ();
111- if (otherIndex < ProductResolverIndexInitializing) {
112- branchType_ = other.branchType_ ;
113- typeID_ = other.typeID_ ;
114- productRegistry_ = other.productRegistry_ ;
115- index_.store (otherIndex);
116- } else {
117- branchType_ = NumBranchTypes;
118- typeID_ = TypeID ();
119- productRegistry_ = nullptr ;
120- index_.store (ProductResolverIndexInvalid);
121- }
65+ token_.store (other.token_ .load ());
12266 }
12367 return *this ;
12468 }
@@ -129,19 +73,7 @@ namespace edm {
12973 instance_ = std::move (other.instance_ );
13074 process_ = std::move (other.process_ );
13175 skipCurrentProcess_ = other.skipCurrentProcess_ ;
132-
133- ProductResolverIndex otherIndex = other.index_ .load ();
134- if (otherIndex < ProductResolverIndexInitializing) {
135- branchType_ = other.branchType_ ;
136- typeID_ = other.typeID_ ;
137- productRegistry_ = other.productRegistry_ ;
138- index_.store (otherIndex);
139- } else {
140- branchType_ = NumBranchTypes;
141- typeID_ = TypeID ();
142- productRegistry_ = nullptr ;
143- index_.store (ProductResolverIndexInvalid);
144- }
76+ token_.store (other.token_ .load ());
14577 }
14678 return *this ;
14779 }
@@ -174,30 +106,7 @@ namespace edm {
174106 return (label_ == tag.label_ ) && (instance_ == tag.instance_ ) && (process_ == tag.process_ );
175107 }
176108
177- ProductResolverIndex InputTag::indexFor (TypeID const & typeID,
178- BranchType branchType,
179- void const * productRegistry) const {
180- ProductResolverIndex index = index_.load ();
181-
182- if (index < ProductResolverIndexInitializing && typeID_ == typeID && branchType_ == branchType &&
183- productRegistry_ == productRegistry) {
184- return index;
185- }
186- return ProductResolverIndexInvalid;
187- }
188-
189- void InputTag::tryToCacheIndex (ProductResolverIndex index,
190- TypeID const & typeID,
191- BranchType branchType,
192- void const * productRegistry) const {
193- unsigned int invalidValue = static_cast <unsigned int >(ProductResolverIndexInvalid);
194- if (index_.compare_exchange_strong (invalidValue, static_cast <unsigned int >(ProductResolverIndexInitializing))) {
195- typeID_ = typeID;
196- branchType_ = branchType;
197- productRegistry_ = productRegistry;
198- index_.store (index);
199- }
200- }
109+ void InputTag::cacheToken (EDGetToken token) const { token_.store (token); }
201110
202111 std::ostream& operator <<(std::ostream& ost, InputTag const & tag) {
203112 static std::string const process (" , process = " );
0 commit comments