LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
ModuleType.h
Go to the documentation of this file.
1 #ifndef art_Framework_Core_ModuleType_h
2 #define art_Framework_Core_ModuleType_h
3 
5 // Enum and associated utilities to help with module classification and
6 // construction.
7 //
9 
11 
12 #include <string>
13 
14 namespace art {
15  // Forward declarations for specializations.
16  class EDAnalyzer;
17  class EDFilter;
18  class OutputModule;
19  class EDProducer;
20 
21  // ModuleType.
23 
24  std::string to_string(ModuleType mt);
25 
26  // Useful functions.
27  bool is_observer(ModuleType mt);
28  bool is_modifier(ModuleType mt);
29 }
30 
31 inline std::string
33 {
34  switch (mt) {
36  return "non-art";
38  return "analyzer";
39  case ModuleType::FILTER:
40  return "filter";
42  return "producer";
43  case ModuleType::OUTPUT:
44  return "output module";
45  default:
47  << "Unable to find string for unrecognized ModuleType value "
48  << static_cast<int>(mt) << ".\n";
49  }
50 }
51 
52 inline bool
54 {
55  return mt == ModuleType::ANALYZER || mt == ModuleType::OUTPUT;
56 }
57 
58 inline bool
60 {
61  return mt == ModuleType::FILTER || mt == ModuleType::PRODUCER;
62 }
63 #endif /* art_Framework_Core_ModuleType_h */
64 
65 // Local Variables:
66 // mode: c++
67 // End:
bool is_modifier(ModuleType mt)
Definition: ModuleType.h:59
bool is_observer(ModuleType mt)
Definition: ModuleType.h:53
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
HLT enums.
std::string to_string(ModuleType mt)
Definition: ModuleType.h:32
ModuleType
Definition: ModuleType.h:22