LArSoft
v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
ModuleMacros.h
Go to the documentation of this file.
1
#ifndef art_Framework_Core_ModuleMacros_h
2
#define art_Framework_Core_ModuleMacros_h
3
5
// ModuleMacros
6
//
7
// Defines the macro DEFINE_ART_MODULE(<module_classname>) to be used in
8
// XXX_module.cc to declare art modules (analyzers, filters, producers
9
// and outputs).
10
//
11
// Note: Libraries that include these symbol definitions cannot be
12
// linked into a main program as other libraries are. This is because
13
// the "one definition" rule would be violated.
14
//
16
17
#include "
art/Framework/Core/ModuleType.h
"
18
#include "
art/Framework/Core/WorkerT.h
"
19
#include "
art/Framework/Core/detail/ModuleTypeDeducer.h
"
20
#include "
art/Framework/Principal/WorkerParams.h
"
21
#include "
canvas/Persistency/Provenance/ModuleDescription.h
"
22
#include "cetlib/ProvideFilePathMacro.h"
23
#include "
fhiclcpp/ParameterSet.h
"
24
#include "
fhiclcpp/types/AllowedConfigurationMacro.h
"
25
26
#include "
art/Framework/Core/EventObserverBase.h
"
27
28
#include <memory>
29
#include <ostream>
30
#include <string>
31
32
// Function aliases (used in art).
33
namespace
art
{
34
namespace
detail {
35
using
WorkerMaker_t
= Worker*(WorkerParams
const
&,
36
ModuleDescription
const
&);
37
using
ModuleTypeFunc_t
=
ModuleType
();
38
}
39
}
40
41
// Produce the injected functions
42
#define DEFINE_ART_MODULE(klass) \
43
extern "C" { \
44
CET_PROVIDE_FILE_PATH() \
45
FHICL_PROVIDE_ALLOWED_CONFIGURATION(klass) \
46
art::Worker* \
47
make_worker(art::WorkerParams const& wp, art::ModuleDescription const& md) \
48
{ \
49
return new klass::WorkerType( \
50
std::unique_ptr<klass::ModuleType>(new klass(wp.pset_)), md, wp); \
51
} \
52
art::ModuleType \
53
moduleType() \
54
{ \
55
return art::detail::ModuleTypeDeducer<klass::ModuleType>::value; \
56
} \
57
}
58
59
#endif
/* art_Framework_Core_ModuleMacros_h */
60
61
// Local Variables:
62
// mode: c++
63
// End:
EventObserverBase.h
ModuleTypeDeducer.h
AllowedConfigurationMacro.h
WorkerParams.h
ModuleDescription.h
art::detail::WorkerMaker_t
Worker *(WorkerParams const &, ModuleDescription const &) WorkerMaker_t
Definition:
ModuleMacros.h:36
ParameterSet.h
WorkerT.h
art::detail::ModuleTypeFunc_t
ModuleType( ModuleTypeFunc_t)
Definition:
ModuleMacros.h:37
art
HLT enums.
Definition:
ServiceProviderWrappers.h:36
ModuleType.h
art::ModuleDescription
Definition:
ModuleDescription.h:24
art::ModuleType
ModuleType
Definition:
ModuleType.h:22
art
Framework
Core
ModuleMacros.h
Generated on Wed Dec 12 2018 14:42:32 for LArSoft by
1.8.11