LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
art::ActionTable Class Reference

#include "Actions.h"

Public Member Functions

 ActionTable ()
 
 ActionTable (fhicl::ParameterSet const &)
 
void add (std::string const &category, actions::ActionCodes code)
 
actions::ActionCodes find (std::string const &category) const
 

Private Types

using ActionMap = std::map< std::string, actions::ActionCodes >
 

Private Member Functions

void addDefaults_ ()
 
void install_ (actions::ActionCodes code, fhicl::ParameterSet const &scheduler)
 

Private Attributes

ActionMap map_
 

Detailed Description

Definition at line 19 of file Actions.h.

Member Typedef Documentation

using art::ActionTable::ActionMap = std::map<std::string, actions::ActionCodes>
private

Definition at line 28 of file Actions.h.

Constructor & Destructor Documentation

art::ActionTable::ActionTable ( )

Definition at line 42 of file Actions.cc.

References addDefaults_().

42 : map_() { addDefaults_(); }
void addDefaults_()
Definition: Actions.cc:57
ActionMap map_
Definition: Actions.h:34
art::ActionTable::ActionTable ( fhicl::ParameterSet const &  scheduleOpts)
explicit

Definition at line 44 of file Actions.cc.

References addDefaults_(), art::actions::FailModule, art::actions::FailPath, fhicl::ParameterSet::get(), art::actions::IgnoreCompletely, install_(), art::actions::Rethrow, and art::actions::SkipEvent.

44  : map_()
45  {
46  if (scheduleOpts.get<bool>("defaultExceptions", true)) {
47  addDefaults_();
48  }
49  install_(actions::SkipEvent, scheduleOpts);
50  install_(actions::Rethrow, scheduleOpts);
51  install_(actions::IgnoreCompletely, scheduleOpts);
52  install_(actions::FailModule, scheduleOpts);
53  install_(actions::FailPath, scheduleOpts);
54  }
void addDefaults_()
Definition: Actions.cc:57
void install_(actions::ActionCodes code, fhicl::ParameterSet const &scheduler)
Definition: Actions.cc:70
ActionMap map_
Definition: Actions.h:34

Member Function Documentation

void art::ActionTable::add ( std::string const &  category,
actions::ActionCodes  code 
)

Definition at line 81 of file Actions.cc.

References map_.

Referenced by install_().

82  {
83  map_[category] = code;
84  }
ActionMap map_
Definition: Actions.h:34
void art::ActionTable::addDefaults_ ( )
private

Definition at line 57 of file Actions.cc.

References art::debugit, and map_.

Referenced by ActionTable().

58  {
59  // This is where defaults that are not 'Rethrow' would be populated.
60  if (2 > debugit())
61  return;
62 
63  for (auto const& pr : map_) {
64  cerr << pr.first << ',' << pr.second << '\n';
65  }
66  cerr << endl;
67  }
debugvalue debugit
Definition: DebugMacros.cc:12
ActionMap map_
Definition: Actions.h:34
actions::ActionCodes art::ActionTable::find ( std::string const &  category) const

Definition at line 87 of file Actions.cc.

References evd::details::end(), map_, and art::actions::Rethrow.

Referenced by art::Worker::doWork(), art::Path::handleWorkerFailure(), art::EndPathExecutor::process(), art::Schedule::process(), and art::EventProcessor::process_().

88  {
89  auto it = map_.find(category);
90  return it != end(map_) ? it->second : actions::Rethrow;
91  }
ActionMap map_
Definition: Actions.h:34
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
void art::ActionTable::install_ ( actions::ActionCodes  code,
fhicl::ParameterSet const &  scheduler 
)
private

Definition at line 70 of file Actions.cc.

References art::actions::actionName(), add(), and fhicl::ParameterSet::get().

Referenced by ActionTable().

72  {
73  auto const& action_names =
74  scheduler.get<vector<string>>(actionName(code), {});
75  for_all(action_names, [this, code](auto const& action_name) {
76  this->add(action_name, code);
77  });
78  }
void add(std::string const &category, actions::ActionCodes code)
Definition: Actions.cc:81
char const * actionName(ActionCodes const code)
Definition: Actions.cc:33

Member Data Documentation

ActionMap art::ActionTable::map_
private

Definition at line 34 of file Actions.h.

Referenced by add(), addDefaults_(), and find().


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