CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/FWCore/PluginManager/src/PresenceFactory.cc

Go to the documentation of this file.
00001 #include "FWCore/PluginManager/interface/PresenceFactory.h"
00002 #include "FWCore/Utilities/interface/EDMException.h"
00003 #include "FWCore/Utilities/interface/DebugMacros.h"
00004 
00005 #include <iostream>
00006 
00007 EDM_REGISTER_PLUGINFACTORY(edm::PresencePluginFactory,"CMS EDM Framework Presence");
00008 
00009 namespace edm {
00010   
00011   PresenceFactory::~PresenceFactory() {
00012   }
00013 
00014   PresenceFactory::PresenceFactory() {
00015   }
00016 
00017 
00018   PresenceFactory* PresenceFactory::get() {
00019     static PresenceFactory singleInstance_;
00020     return &singleInstance_;
00021   }
00022 
00023   std::auto_ptr<Presence>
00024   PresenceFactory::
00025   makePresence(std::string const & presence_type) const {
00026     std::auto_ptr<Presence> sp(PresencePluginFactory::get()->create(presence_type));
00027 
00028     if(sp.get()==0) {
00029         throw edm::Exception(errors::Configuration, "NoPresenceModule")
00030           << "Presence Factory:\n"
00031           << "Cannot find presence type: "
00032           << presence_type << "\n"
00033           << "Perhaps the name is misspelled or is not a Plugin?\n"
00034           << "Try running EdmPluginDump to obtain a list of available Plugins.";
00035     }
00036 
00037     FDEBUG(1) << "PresenceFactory: created presence "
00038               << presence_type
00039               << std::endl;
00040 
00041     return sp;
00042   }
00043 }
00044