CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
edm::WillGetIfMatch< T > Class Template Reference

#include <EDConsumerBase.h>

Public Member Functions

EDGetTokenT< Toperator() (BranchDescription const &branchDescription)
 
template<typename U >
 WillGetIfMatch (U const &match, EDConsumerBase *module)
 

Private Attributes

std::function< bool(BranchDescription const &)> match_
 
EDConsumerBasemodule_
 

Detailed Description

template<typename T>
class edm::WillGetIfMatch< T >

This is intended to be used only by the class GetterOfProducts. See comments in the file GetterOfProducts.h.

Author
W. David Dagenhart, created 6 August, 2012

Definition at line 65 of file EDConsumerBase.h.

Constructor & Destructor Documentation

◆ WillGetIfMatch()

template<typename T >
template<typename U >
edm::WillGetIfMatch< T >::WillGetIfMatch ( U const &  match,
EDConsumerBase module 
)
inline

Definition at line 25 of file WillGetIfMatch.h.

25 : match_(match), module_(module) {}

Member Function Documentation

◆ operator()()

template<typename T >
EDGetTokenT<T> edm::WillGetIfMatch< T >::operator() ( BranchDescription const &  branchDescription)
inline

Definition at line 27 of file WillGetIfMatch.h.

27  {
28  if (match_(branchDescription)) {
29  auto transition = branchDescription.branchType();
31  branchDescription.moduleLabel(), branchDescription.productInstanceName(), branchDescription.processName()};
32  if (transition == edm::InEvent) {
33  return module_->template consumes<T>(tag);
34  } else if (transition == edm::InLumi) {
35  return module_->template consumes<T, edm::InLumi>(tag);
36  } else if (transition == edm::InRun) {
37  return module_->template consumes<T, edm::InRun>(tag);
38  } else if (transition == edm::InProcess) {
39  return module_->template consumes<T, edm::InProcess>(tag);
40  }
41  }
42  return EDGetTokenT<T>{};
43  }

References edm::BranchDescription::branchType(), edm::InEvent, edm::InLumi, edm::InProcess, edm::InRun, edm::WillGetIfMatch< T >::match_, edm::WillGetIfMatch< T >::module_, edm::BranchDescription::moduleLabel(), edm::BranchDescription::processName(), edm::BranchDescription::productInstanceName(), and GlobalPosition_Frontier_DevDB_cff::tag.

Member Data Documentation

◆ match_

template<typename T >
std::function<bool(BranchDescription const&)> edm::WillGetIfMatch< T >::match_
private

Definition at line 46 of file WillGetIfMatch.h.

Referenced by edm::WillGetIfMatch< T >::operator()().

◆ module_

template<typename T >
EDConsumerBase* edm::WillGetIfMatch< T >::module_
private

Definition at line 47 of file WillGetIfMatch.h.

Referenced by edm::WillGetIfMatch< T >::operator()().

edm::InRun
Definition: BranchType.h:11
edm::InProcess
Definition: BranchType.h:11
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
edm::InEvent
Definition: BranchType.h:11
edm::InLumi
Definition: BranchType.h:11
edm::WillGetIfMatch::match_
std::function< bool(BranchDescription const &)> match_
Definition: WillGetIfMatch.h:46
edm::WillGetIfMatch::module_
EDConsumerBase * module_
Definition: WillGetIfMatch.h:47
edm::match
std::string match(BranchDescription const &a, BranchDescription const &b, std::string const &fileName)
Definition: BranchDescription.cc:351
edm::InputTag
Definition: InputTag.h:15