checkDictionaries.cc
Go to the documentation of this file.
2 // vim: set sw=2:
3 
6 #include "canvas_root_io/Streamers/AssnsStreamer.h"
7 #include "canvas_root_io/Streamers/BranchDescriptionStreamer.h"
8 #include "canvas_root_io/Utilities/DictionaryChecker.h"
9 #include "canvas_root_io/Utilities/TypeTools.h"
11 
12 void
14 {
16 
17  // Make sure we populate the ROOT-related transient information. If
18  // this is not done, then TBranch-related quantities will not be set
19  // correctly.
20  detail::BranchDescriptionStreamer::fluffRootTransients(productDesc);
21  auto const isTransient = productDesc.transient();
22 
23  // Check product dictionaries.
24  static root::DictionaryChecker dictChecker{};
25  dictChecker.checkDictionaries(productDesc.wrappedName(), false);
26  dictChecker.checkDictionaries(productDesc.producedClassName(), !isTransient);
27 
28  // Check dictionaries for assnsPartner, if appropriate. This is only
29  // necessary for top-level checks so appropriate here rather than
30  // checkDictionaries itself.
31  if (!isTransient) {
32  auto const assnsPartner =
34  if (!assnsPartner.empty()) {
35  dictChecker.checkDictionaries(wrappedClassName(assnsPartner), true);
36  }
37  }
38  dictChecker.reportMissingDictionaries();
39 
40  // Make sure that the AssnsStreamer is appropropriately setup--must
41  // be done after we are sure that there is matching dictionary for
42  // the partner.
43  if (!is_assns(productDesc.producedClassName()))
44  return;
45 
46  detail::AssnsStreamer::init_streamer(productDesc.producedClassName());
47 }
#define CET_ASSERT_ONLY_ONE_THREAD()
std::string const & wrappedName() const noexcept
std::string wrappedClassName(std::string const &className)
string name_of_assns_partner(string assns_type_name)
Definition: TypeID.cc:193
void checkDictionaries(BranchDescription const &productDesc)
std::string const & producedClassName() const noexcept
bool transient() const noexcept
bool is_assns(std::string const &type_name)
Definition: TypeID.h:85