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 47 of file EDConsumerBase.h.

Constructor & Destructor Documentation

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

Definition at line 27 of file WillGetIfMatch.h.

27  :
28  match_(match),
29  module_(module) {
30  }
EDConsumerBase * module_
std::function< bool(BranchDescription const &)> match_
Definition: vlib.h:208
std::string match(BranchDescription const &a, BranchDescription const &b, std::string const &fileName)

Member Function Documentation

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

Definition at line 32 of file WillGetIfMatch.h.

References edm::BranchDescription::branchType(), edm::InEvent, edm::InLumi, 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.

32  {
33  if (match_(branchDescription)){
34  auto transition = branchDescription.branchType();
35  edm::InputTag tag{branchDescription.moduleLabel(),
36  branchDescription.productInstanceName(),
37  branchDescription.processName()};
38  if(transition == edm::InEvent) {
39  return module_->template consumes<T>(tag);
40  } else if(transition == edm::InLumi) {
41  return module_->template consumes<T,edm::InLumi>(tag);
42  } else if(transition == edm::InRun) {
43  return module_->template consumes<T,edm::InRun>(tag);
44  }
45  }
46  return EDGetTokenT<T>{};
47  }
EDConsumerBase * module_
std::function< bool(BranchDescription const &)> match_

Member Data Documentation

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

Definition at line 50 of file WillGetIfMatch.h.

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

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

Definition at line 51 of file WillGetIfMatch.h.

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