LArSoft
v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
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
10
#include "
canvas/Utilities/Exception.h
"
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.
22
enum class
ModuleType
{
NON_ART
,
ANALYZER
,
FILTER
,
PRODUCER
,
OUTPUT
};
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
32
art::to_string
(
ModuleType
mt)
33
{
34
switch
(mt) {
35
case
ModuleType::NON_ART
:
36
return
"non-art"
;
37
case
ModuleType::ANALYZER
:
38
return
"analyzer"
;
39
case
ModuleType::FILTER
:
40
return
"filter"
;
41
case
ModuleType::PRODUCER
:
42
return
"producer"
;
43
case
ModuleType::OUTPUT
:
44
return
"output module"
;
45
default
:
46
throw
Exception
(
errors::LogicError
)
47
<<
"Unable to find string for unrecognized ModuleType value "
48
<<
static_cast<
int
>
(mt) <<
".\n"
;
49
}
50
}
51
52
inline
bool
53
art::is_observer
(
ModuleType
const
mt)
54
{
55
return
mt ==
ModuleType::ANALYZER
|| mt ==
ModuleType::OUTPUT
;
56
}
57
58
inline
bool
59
art::is_modifier
(
ModuleType
const
mt)
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:
art::ModuleType::PRODUCER
art::is_modifier
bool is_modifier(ModuleType mt)
Definition:
ModuleType.h:59
art::errors::LogicError
Definition:
Exception.h:33
art::ModuleType::FILTER
art::ModuleType::ANALYZER
art::is_observer
bool is_observer(ModuleType mt)
Definition:
ModuleType.h:53
art::Exception
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition:
Exception.h:66
art
HLT enums.
Definition:
ServiceProviderWrappers.h:36
art::to_string
std::string to_string(ModuleType mt)
Definition:
ModuleType.h:32
art::ModuleType::NON_ART
art::ModuleType::OUTPUT
Exception.h
art::ModuleType
ModuleType
Definition:
ModuleType.h:22
art
Framework
Core
ModuleType.h
Generated on Thu Jul 26 2018 13:09:39 for LArSoft by
1.8.11