FWCore
Framework
src
InputSourceFactory.cc
Go to the documentation of this file.
1
2
#include "
FWCore/Framework/src/InputSourceFactory.h
"
3
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
4
#include "
FWCore/Utilities/interface/DebugMacros.h
"
5
#include "
FWCore/Utilities/interface/EDMException.h
"
6
7
#include <iostream>
8
9
EDM_REGISTER_PLUGINFACTORY
(
edm::InputSourcePluginFactory
,
"CMS EDM Framework InputSource"
);
10
namespace
edm
{
11
12
InputSourceFactory::~InputSourceFactory
() {}
13
14
InputSourceFactory::InputSourceFactory
() {}
15
16
InputSourceFactory
const
InputSourceFactory::singleInstance_
;
17
18
InputSourceFactory
const
*
InputSourceFactory::get
() {
19
// will not work with plugin factories
20
//static InputSourceFactory f;
21
//return &f;
22
23
return
&
singleInstance_
;
24
}
25
26
std::unique_ptr<InputSource>
InputSourceFactory::makeInputSource
(
ParameterSet
const
& conf,
27
InputSourceDescription
const
& desc)
const
28
29
{
30
std::string
modtype = conf.
getParameter
<
std::string
>(
"@module_type"
);
31
FDEBUG
(1) <<
"InputSourceFactory: module_type = "
<< modtype << std::endl;
32
auto
wm =
InputSourcePluginFactory::get
()->create(modtype, conf, desc);
33
34
if
(wm.get() ==
nullptr
) {
35
throw
edm::Exception
(
errors::Configuration
,
"NoSourceModule"
)
36
<<
"InputSource Factory:\n"
37
<<
"Cannot find source type from ParameterSet: "
<< modtype <<
"\n"
38
<<
"Perhaps your source type is misspelled or is not an EDM Plugin?\n"
39
<<
"Try running EdmPluginDump to obtain a list of available Plugins."
;
40
}
41
42
wm->registerProducts();
43
44
FDEBUG
(1) <<
"InputSourceFactory: created input source "
<< modtype << std::endl;
45
46
return
wm;
47
}
48
49
}
// namespace edm
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::InputSourceFactory::singleInstance_
static const InputSourceFactory singleInstance_
Definition:
InputSourceFactory.h:26
edm::InputSourceFactory::get
static InputSourceFactory const * get()
Definition:
InputSourceFactory.cc:18
edm::InputSourceDescription
Definition:
InputSourceDescription.h:20
edm::InputSourceFactory::InputSourceFactory
InputSourceFactory()
Definition:
InputSourceFactory.cc:14
EDMException.h
edm::InputSourceFactory::makeInputSource
std::unique_ptr< InputSource > makeInputSource(ParameterSet const &, InputSourceDescription const &) const
Definition:
InputSourceFactory.cc:26
EDM_REGISTER_PLUGINFACTORY
#define EDM_REGISTER_PLUGINFACTORY(_factory_, _category_)
Definition:
PluginFactory.h:89
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition:
ParameterSet.h:36
FDEBUG
#define FDEBUG(lev)
Definition:
DebugMacros.h:19
edmplugin::PluginFactory
Definition:
PluginFactory.h:34
edm::InputSourceFactory
Definition:
InputSourceFactory.h:16
get
#define get
edm::InputSourceFactory::~InputSourceFactory
~InputSourceFactory()
Definition:
InputSourceFactory.cc:12
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
InputSourceFactory.h
Exception
Definition:
hltDiff.cc:246
DebugMacros.h
ParameterSet.h
edm::errors::Configuration
Definition:
EDMException.h:36
Generated for CMSSW Reference Manual by
1.8.16