Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
art::ActionTable Class Reference

#include <Actions.h>

Classes

struct  Config
 

Public Member Functions

 ~ActionTable ()
 
 ActionTable ()
 
 ActionTable (Config const &)
 
 ActionTable (ActionTable const &)=delete
 
 ActionTable (ActionTable &&)=delete
 
ActionTableoperator= (ActionTable const &)=delete
 
ActionTableoperator= (ActionTable &&)=delete
 
actions::ActionCodes find (std::string const &category) const
 
void add (std::string const &category, actions::ActionCodes)
 

Private Member Functions

void addDefaults_ ()
 
void install_ (actions::ActionCodes, std::vector< std::string > const &)
 

Private Attributes

std::map< std::string, actions::ActionCodesmap_ {}
 

Detailed Description

Definition at line 18 of file Actions.h.

Constructor & Destructor Documentation

art::ActionTable::~ActionTable ( )
default
art::ActionTable::ActionTable ( )

Definition at line 28 of file Actions.cc.

28 { addDefaults_(); }
void addDefaults_()
Definition: Actions.cc:43
art::ActionTable::ActionTable ( Config const &  c)
explicit

Definition at line 30 of file Actions.cc.

31  {
32  if (c.defaultExceptions()) {
33  addDefaults_();
34  }
35  install_(actions::IgnoreCompletely, c.ignoreCompletely());
36  install_(actions::Rethrow, c.rethrow());
37  install_(actions::SkipEvent, c.skipEvent());
38  install_(actions::FailModule, c.failModule());
39  install_(actions::FailPath, c.failPath());
40  }
void addDefaults_()
Definition: Actions.cc:43
void install_(actions::ActionCodes, std::vector< std::string > const &)
Definition: Actions.cc:56
art::ActionTable::ActionTable ( ActionTable const &  )
delete
art::ActionTable::ActionTable ( ActionTable &&  )
delete

Member Function Documentation

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

Definition at line 65 of file Actions.cc.

66  {
67  map_[category] = code;
68  }
std::map< std::string, actions::ActionCodes > map_
Definition: Actions.h:51
CodeOutputInterface * code
void art::ActionTable::addDefaults_ ( )
private

Definition at line 43 of file Actions.cc.

44  {
45  // This is where defaults that are not 'Rethrow' would be populated.
46  if (2 > debugit())
47  return;
48 
49  for (auto const& pr : map_) {
50  cerr << pr.first << ',' << pr.second << '\n';
51  }
52  cerr << endl;
53  }
std::map< std::string, actions::ActionCodes > map_
Definition: Actions.h:51
DebugValue debugit
Definition: DebugMacros.cc:14
QTextStream & endl(QTextStream &s)
actions::ActionCodes art::ActionTable::find ( std::string const &  category) const

Definition at line 71 of file Actions.cc.

72  {
73  auto I = map_.find(category);
74  return (I != map_.end()) ? I->second : actions::Rethrow;
75  }
std::map< std::string, actions::ActionCodes > map_
Definition: Actions.h:51
void art::ActionTable::install_ ( actions::ActionCodes  code,
std::vector< std::string > const &  action_names 
)
private

Definition at line 56 of file Actions.cc.

58  {
59  for_all(action_names, [this, code](auto const& action_name) {
60  this->add(action_name, code);
61  });
62  }
void add(std::string const &category, actions::ActionCodes)
Definition: Actions.cc:65
CodeOutputInterface * code
auto for_all(FwdCont &, Func)
ActionTable& art::ActionTable::operator= ( ActionTable const &  )
delete
ActionTable& art::ActionTable::operator= ( ActionTable &&  )
delete

Member Data Documentation

std::map<std::string, actions::ActionCodes> art::ActionTable::map_ {}
private

Definition at line 51 of file Actions.h.


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