LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
Actions.cc
Go to the documentation of this file.
2 // vim: set sw=2 expandtab :
3 
6 #include "cetlib/container_algorithms.h"
7 
8 namespace art {
9 
10  ActionTable::~ActionTable() = default;
11 
13  {
14  addDefaults_();
15  }
16 
18  {
19  if (c.defaultExceptions()) {
20  addDefaults_();
21  }
27  }
28 
29  void
31  {
32  // This is where defaults that are not 'Rethrow' would be populated.
33  if (2 > debugit())
34  return;
35 
36  for (auto const& [name, code] : map_) {
37  std::cerr << name << ',' << code << '\n';
38  }
39  std::cerr << '\n';
40  }
41 
42  void
44  std::vector<std::string> const& action_names)
45  {
46  cet::for_all(action_names, [this, code](auto const& action_name) {
47  add(action_name, code);
48  });
49  }
50 
51  void
52  ActionTable::add(std::string const& category, actions::ActionCodes const code)
53  {
54  map_[category] = code;
55  }
56 
58  ActionTable::find(std::string const& category) const
59  {
60  auto I = map_.find(category);
61  return (I != map_.end()) ? I->second : actions::Rethrow;
62  }
63 
64 } // namespace art
void add(std::string const &category, actions::ActionCodes)
Definition: Actions.cc:52
std::map< std::string, actions::ActionCodes > map_
Definition: Actions.h:48
fhicl::Sequence< std::string > ignoreCompletely
Definition: Actions.h:23
actions::ActionCodes find(std::string const &category) const
Definition: Actions.cc:58
DebugValue debugit
Definition: DebugMacros.cc:14
void addDefaults_()
Definition: Actions.cc:30
fhicl::Sequence< std::string > skipEvent
Definition: Actions.h:26
fhicl::Atom< bool > defaultExceptions
Definition: Actions.h:22
void install_(actions::ActionCodes, std::vector< std::string > const &)
Definition: Actions.cc:43
Definition: MVAAlg.h:12
fhicl::Sequence< std::string > rethrow
Definition: Actions.h:25
fhicl::Sequence< std::string > failModule
Definition: Actions.h:27
fhicl::Sequence< std::string > failPath
Definition: Actions.h:28