Public Member Functions | Private Attributes | List of all members
art::detail::PrincipalProcessor< DETAIL > Class Template Reference

#include <ProvenanceDumperImpl.h>

Public Member Functions

 PrincipalProcessor (DETAIL &detail, bool const wantPresentOnly, bool const resolveProducts, bool const wantResolvedOnly)
 
void operator() (art::Principal const &p, void(DETAIL::*func)(art::Provenance const &)) const
 

Private Attributes

DETAIL & detail_
 
bool const wantPresentOnly_
 
bool const resolveProducts_
 
bool const wantResolvedOnly_
 

Detailed Description

template<typename DETAIL>
class art::detail::PrincipalProcessor< DETAIL >

Definition at line 27 of file ProvenanceDumperImpl.h.

Constructor & Destructor Documentation

template<typename DETAIL>
art::detail::PrincipalProcessor< DETAIL >::PrincipalProcessor ( DETAIL &  detail,
bool const  wantPresentOnly,
bool const  resolveProducts,
bool const  wantResolvedOnly 
)
inline

Definition at line 29 of file ProvenanceDumperImpl.h.

33  : detail_(detail)
34  , wantPresentOnly_(wantPresentOnly)
35  , resolveProducts_(resolveProducts)
36  , wantResolvedOnly_(wantResolvedOnly)
37  {}

Member Function Documentation

template<typename DETAIL >
void art::detail::PrincipalProcessor< DETAIL >::operator() ( art::Principal const &  p,
void(DETAIL::*)(art::Provenance const &)  func 
) const

Definition at line 51 of file ProvenanceDumperImpl.h.

54  {
55  for (auto const& pr : p) {
56  Group const& g = *pr.second;
57  if (resolveProducts_) {
58  bool const resolved_product = g.resolveProductIfAvailable();
59  if (!resolved_product) {
60  continue;
61  }
62  }
63  bool wantCallFunc = true;
64  Provenance const prov{cet::make_exempt_ptr(&g)};
65  if (wantResolvedOnly_) {
66  wantCallFunc = (g.anyProduct() != nullptr);
67  } else if (wantPresentOnly_) {
68  // Unfortunately, there are files in which the product
69  // provenance has not been appropriately stored for dropped
70  // products. The first check below on the product
71  // provenance pointer is a precondition to calling
72  // prov.isPresent(), getting around this incorrect
73  // persistency behavior.
74  wantCallFunc = (g.productProvenance() != nullptr) && prov.isPresent();
75  }
76 
77  if (wantCallFunc) {
78  (detail_.*func)(prov);
79  }
80  }
81  }
static constexpr double g
Definition: Units.h:144
constexpr exempt_ptr< E > make_exempt_ptr(E *) noexcept
p
Definition: test.py:223
def func()
Definition: docstring.py:7

Member Data Documentation

template<typename DETAIL>
DETAIL& art::detail::PrincipalProcessor< DETAIL >::detail_
private

Definition at line 43 of file ProvenanceDumperImpl.h.

template<typename DETAIL>
bool const art::detail::PrincipalProcessor< DETAIL >::resolveProducts_
private

Definition at line 45 of file ProvenanceDumperImpl.h.

template<typename DETAIL>
bool const art::detail::PrincipalProcessor< DETAIL >::wantPresentOnly_
private

Definition at line 44 of file ProvenanceDumperImpl.h.

template<typename DETAIL>
bool const art::detail::PrincipalProcessor< DETAIL >::wantResolvedOnly_
private

Definition at line 46 of file ProvenanceDumperImpl.h.


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