CMS 3D CMS Logo

PresenceFactory.cc
Go to the documentation of this file.
5 
6 #include <iostream>
7 
9 
10 namespace edm {
11 
13 
15 
17  CMS_THREAD_SAFE static PresenceFactory singleInstance_;
18  return &singleInstance_;
19  }
20 
21  std::unique_ptr<Presence> PresenceFactory::makePresence(std::string const& presence_type) const {
22  std::unique_ptr<Presence> sp(PresencePluginFactory::get()->create(presence_type));
23 
24  if (sp.get() == nullptr) {
25  throw edm::Exception(errors::Configuration, "NoPresenceModule")
26  << "Presence Factory:\n"
27  << "Cannot find presence type: " << presence_type << "\n"
28  << "Perhaps the name is misspelled or is not a Plugin?\n"
29  << "Try running EdmPluginDump to obtain a list of available Plugins.";
30  }
31 
32  FDEBUG(1) << "PresenceFactory: created presence " << presence_type << std::endl;
33 
34  return sp;
35  }
36 } // namespace edm
#define EDM_REGISTER_PLUGINFACTORY(_factory_, _category_)
Definition: PluginFactory.h:89
def create(alignables, pedeDump, additionalData, outputFile, config)
#define CMS_THREAD_SAFE
static PresenceFactory * get()
HLT enums.
std::unique_ptr< Presence > makePresence(std::string const &presence_type) const
#define FDEBUG(lev)
Definition: DebugMacros.h:19