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) {}
EDConsumerBase * module_
std::function< bool(BranchDescription const &)> match_
std::string match(BranchDescription const &a, BranchDescription const &b, std::string const &fileName)

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.

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 makeGlobalPositionRcd_cfg::tag.

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  }
EDConsumerBase * module_
std::function< bool(BranchDescription const &)> match_

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()().