Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
art
art
Framework
Core
InputSourceFactory.cc
Go to the documentation of this file.
1
#include "
art/Framework/Core/InputSourceFactory.h
"
2
// vim: set sw=2 expandtab :
3
4
#include "
art/Framework/Core/InputSource.h
"
5
#include "
art/Utilities/PluginSuffixes.h
"
6
#include "
art/Version/GetReleaseVersion.h
"
7
#include "
canvas/Utilities/DebugMacros.h
"
8
#include "
canvas/Utilities/Exception.h
"
9
#include "
cetlib/LibraryManager.h
"
10
#include "
cetlib/detail/wrapLibraryManagerException.h
"
11
#include "
fhiclcpp/ParameterSet.h
"
12
13
#include <memory>
14
#include <string>
15
16
using namespace
std
;
17
using
fhicl::ParameterSet
;
18
19
namespace
art
{
20
namespace
InputSourceFactory {
21
22
unique_ptr<InputSource>
23
make
(
ParameterSet
const
&
conf
,
InputSourceDescription
&
desc
)
24
{
25
auto
const
& libspec = conf.
get
<
string
>(
"module_type"
);
26
FDEBUG
(1) <<
"InputSourceFactory: module_type = "
<< libspec <<
endl
;
27
using
make_t =
28
unique_ptr<InputSource>(
ParameterSet
const
&,
InputSourceDescription
&);
29
make_t* symbol =
nullptr
;
30
try
{
31
cet::LibraryManager
lm_{Suffixes::source()};
32
lm_.
getSymbolByLibspec
(libspec,
"make"
, symbol);
33
}
34
catch
(
Exception
const
&
e
) {
35
cet::detail::wrapLibraryManagerException
(
36
e,
"InputSource"
, libspec,
getReleaseVersion
());
37
}
38
if
(symbol ==
nullptr
) {
39
throw
Exception
(
errors::Configuration
,
"BadPluginLibrary"
)
40
<<
"InputSource "
<< libspec
41
<<
" has internal symbol definition problems: consult an expert."
;
42
}
43
auto
wm = symbol(conf, desc);
44
FDEBUG
(1) <<
"InputSourceFactory: created input source "
<< libspec
45
<<
endl
;
46
return
wm;
47
}
48
49
}
// namespace InputSourceFactory
50
}
// namespace art
InputSourceFactory.h
wrapLibraryManagerException.h
conf
Definition:
conf.py:1
test_wireplots.desc
desc
Definition:
test_wireplots.py:10
std
STL namespace.
Exception.h
PluginSuffixes.h
InputSource.h
art::errors::Configuration
Definition:
Exception.h:32
ParameterSet.h
cet::LibraryManager::getSymbolByLibspec
T getSymbolByLibspec(std::string const &libspec, std::string const &sym_name) const
Definition:
LibraryManager.h:180
e
const double e
Definition:
gUpMuFluxGen.cxx:165
fhicl::ParameterSet::get
T get(std::string const &key) const
Definition:
ParameterSet.h:271
art::getReleaseVersion
std::string const & getReleaseVersion()
GetReleaseVersion.h
LibraryManager.h
art::InputSourceFactory::make
unique_ptr< InputSource > make(ParameterSet const &conf, InputSourceDescription &desc)
Definition:
InputSourceFactory.cc:23
art::Exception
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition:
Exception.h:66
cet::LibraryManager
Definition:
LibraryManager.h:19
art::InputSourceDescription
Definition:
InputSourceDescription.h:21
art
Definition:
BasicOptionsHandler.h:9
FDEBUG
#define FDEBUG(LEVEL)
Definition:
DebugMacros.h:25
DebugMacros.h
cet::detail::wrapLibraryManagerException
void wrapLibraryManagerException(cet::exception const &e, std::string const &item_type, std::string const &libspec, std::string const &release)
Definition:
wrapLibraryManagerException.cc:5
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
fhicl::ParameterSet
Definition:
ParameterSet.h:36
Generated by
1.8.11