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 52 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 26 of file WillGetIfMatch.h.

26  :
27  match_(match),
28  module_(module) {
29  }
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 31 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.

31  {
32  if (match_(branchDescription)){
33  auto transition = branchDescription.branchType();
34  edm::InputTag tag{branchDescription.moduleLabel(),
35  branchDescription.productInstanceName(),
36  branchDescription.processName()};
37  if(transition == edm::InEvent) {
38  return module_->template consumes<T>(tag);
39  } else if(transition == edm::InLumi) {
40  return module_->template consumes<T,edm::InLumi>(tag);
41  } else if(transition == edm::InRun) {
42  return module_->template consumes<T,edm::InRun>(tag);
43  }
44  }
45  return EDGetTokenT<T>{};
46  }
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 49 of file WillGetIfMatch.h.

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

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

Definition at line 50 of file WillGetIfMatch.h.

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