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 56 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 25 of file WillGetIfMatch.h.

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

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  }
39  }
40  return EDGetTokenT<T>{};
41  }
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 44 of file WillGetIfMatch.h.

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

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

Definition at line 45 of file WillGetIfMatch.h.

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