LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
art::ConsumesCollector Class Reference

#include "ConsumesCollector.h"

Public Member Functions

std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Private Member Functions

void emplace_back (BranchType, ProductInfo::ConsumableType, TypeID const &typeID)
 
void emplace_back (BranchType, ProductInfo::ConsumableType, TypeID const &typeID, InputTag const &tag)
 

Private Attributes

std::array< std::vector< ProductInfo >, NumBranchTypesconsumables_ {}
 

Detailed Description

Definition at line 16 of file ConsumesCollector.h.

Member Function Documentation

template<typename T , BranchType BT>
ProductToken< T > art::ConsumesCollector::consumes ( InputTag const &  tag)

Definition at line 50 of file ConsumesCollector.h.

References emplace_back(), and art::ProductInfo::Product.

Referenced by art::ModuleBase::consumes().

51  {
53  BT, ProductInfo::ConsumableType::Product, TypeID{typeid(T)}, tag);
54  return ProductToken<T>{tag};
55  }
void emplace_back(BranchType, ProductInfo::ConsumableType, TypeID const &typeID)
template<typename T , BranchType BT>
void art::ConsumesCollector::consumesMany ( )

Definition at line 68 of file ConsumesCollector.h.

References emplace_back(), and art::ProductInfo::Many.

Referenced by art::ModuleBase::consumesMany().

69  {
70  emplace_back(BT, ProductInfo::ConsumableType::Many, TypeID{typeid(T)});
71  }
void emplace_back(BranchType, ProductInfo::ConsumableType, TypeID const &typeID)
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::ConsumesCollector::consumesView ( InputTag const &  )
template<typename T , BranchType BT>
ViewToken<T> art::ConsumesCollector::consumesView ( InputTag const &  tag)

Definition at line 59 of file ConsumesCollector.h.

References emplace_back(), and art::ProductInfo::ViewElement.

60  {
62  BT, ProductInfo::ConsumableType::ViewElement, TypeID{typeid(T)}, tag);
63  return ViewToken<T>{tag};
64  }
void emplace_back(BranchType, ProductInfo::ConsumableType, TypeID const &typeID)
void art::ConsumesCollector::emplace_back ( BranchType  bt,
ProductInfo::ConsumableType  contype,
TypeID const &  typeID 
)
private

Definition at line 42 of file ConsumesCollector.cc.

Referenced by consumes(), consumesMany(), consumesView(), mayConsume(), mayConsumeMany(), and mayConsumeView().

45  {
46  consumables_[bt].emplace_back(contype, typeID);
47  }
std::array< std::vector< ProductInfo >, NumBranchTypes > consumables_
void art::ConsumesCollector::emplace_back ( BranchType  bt,
ProductInfo::ConsumableType  contype,
TypeID const &  typeID,
InputTag const &  tag 
)
private

Definition at line 32 of file ConsumesCollector.cc.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

36  {
37  consumables_[bt].emplace_back(
38  contype, typeID, tag.label(), tag.instance(), ProcessTag{tag.process()});
39  }
std::array< std::vector< ProductInfo >, NumBranchTypes > consumables_
array< vector< ProductInfo >, NumBranchTypes > const & art::ConsumesCollector::getConsumables ( ) const

Definition at line 13 of file ConsumesCollector.cc.

Referenced by art::ModuleBase::getConsumables().

14  {
15  return consumables_;
16  }
std::array< std::vector< ProductInfo >, NumBranchTypes > consumables_
template<typename T , BranchType BT>
ProductToken< T > art::ConsumesCollector::mayConsume ( InputTag const &  tag)

Definition at line 75 of file ConsumesCollector.h.

References emplace_back(), and art::ProductInfo::Product.

Referenced by art::ModuleBase::mayConsume().

76  {
78  BT, ProductInfo::ConsumableType::Product, TypeID{typeid(T)}, tag);
79  return ProductToken<T>{tag};
80  }
void emplace_back(BranchType, ProductInfo::ConsumableType, TypeID const &typeID)
template<typename T , BranchType BT>
void art::ConsumesCollector::mayConsumeMany ( )

Definition at line 93 of file ConsumesCollector.h.

References emplace_back(), and art::ProductInfo::Many.

Referenced by art::ModuleBase::mayConsumeMany().

94  {
95  emplace_back(BT, ProductInfo::ConsumableType::Many, TypeID{typeid(T)});
96  }
void emplace_back(BranchType, ProductInfo::ConsumableType, TypeID const &typeID)
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::ConsumesCollector::mayConsumeView ( InputTag const &  )
template<typename T , BranchType BT>
ViewToken<T> art::ConsumesCollector::mayConsumeView ( InputTag const &  tag)

Definition at line 84 of file ConsumesCollector.h.

References emplace_back(), and art::ProductInfo::ViewElement.

85  {
87  BT, ProductInfo::ConsumableType::ViewElement, TypeID{typeid(T)}, tag);
88  return ViewToken<T>{tag};
89  }
void emplace_back(BranchType, ProductInfo::ConsumableType, TypeID const &typeID)
void art::ConsumesCollector::sortConsumables ( std::string const &  current_process_name)

Definition at line 19 of file ConsumesCollector.cc.

References util::begin(), util::end(), and util::pi().

Referenced by art::ModuleBase::sortConsumables().

20  {
21  // Now that we know we have seen all the consumes declarations,
22  // sort the results for fast lookup later.
23  for (auto& perBTConsumables : consumables_) {
24  for (auto& pi : perBTConsumables) {
25  pi.process = ProcessTag{pi.process.name(), current_process_name};
26  }
27  sort(begin(perBTConsumables), end(perBTConsumables));
28  }
29  }
std::array< std::vector< ProductInfo >, NumBranchTypes > consumables_
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Definition: StdUtils.h:77
constexpr T pi()
Returns the constant pi (up to 35 decimal digits of precision)
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
Definition: StdUtils.h:69

Member Data Documentation

std::array<std::vector<ProductInfo>, NumBranchTypes> art::ConsumesCollector::consumables_ {}
private

Definition at line 45 of file ConsumesCollector.h.


The documentation for this class was generated from the following files: