Actions.h
Go to the documentation of this file.
1 #ifndef art_Framework_Principal_Actions_h
2 #define art_Framework_Principal_Actions_h
3 // vim: set sw=2 expandtab :
4 
6 #include "fhiclcpp/types/Atom.h"
8 
9 #include <map>
10 #include <string>
11 #include <vector>
12 
13 namespace art {
14  namespace actions {
15  char const* actionName(ActionCodes code);
16  }
17 
18  class ActionTable {
19  public:
20  ~ActionTable();
21  ActionTable();
22 
23  struct Config {
24  using Name = fhicl::Name;
25  fhicl::Atom<bool> defaultExceptions{Name{"defaultExceptions"}, true};
26  fhicl::Sequence<std::string> ignoreCompletely{Name{"IgnoreCompletely"},
27  {}};
28  fhicl::Sequence<std::string> rethrow{Name{"Rethrow"}, {}};
29  fhicl::Sequence<std::string> skipEvent{Name{"SkipEvent"}, {}};
30  fhicl::Sequence<std::string> failModule{Name{"FailModule"}, {}};
31  fhicl::Sequence<std::string> failPath{Name{"FailPath"}, {}};
32  };
33 
34  explicit ActionTable(Config const&);
35 
36  ActionTable(ActionTable const&) = delete;
37  ActionTable(ActionTable&&) = delete;
38  ActionTable& operator=(ActionTable const&) = delete;
39  ActionTable& operator=(ActionTable&&) = delete;
40 
41  // Accessors
42  actions::ActionCodes find(std::string const& category) const;
43 
44  // Modifiers
45  void add(std::string const& category, actions::ActionCodes);
46 
47  private:
48  void addDefaults_();
49  void install_(actions::ActionCodes, std::vector<std::string> const&);
50 
51  std::map<std::string, actions::ActionCodes> map_{};
52  };
53 } // namespace art
54 
55 #endif /* art_Framework_Principal_Actions_h */
56 
57 // Local Variables:
58 // mode: c++
59 // End:
std::string string
Definition: nybbler.cc:12
Coord add(Coord c1, Coord c2)
Definition: restypedef.cpp:23
ChannelGroupService::Name Name
char const * actionName(ActionCodes code)
Definition: Actions.cc:16
CodeOutputInterface * code
Namespace containing all the test actions.