00001 // -*- C++ -*- 00002 // 00003 // Package: Services 00004 // Class : LoadAllDictionaries 00005 // 00006 // Implementation: 00007 // <Notes on implementation> 00008 // 00009 // Original Author: Chris Jones 00010 // Created: Thu Sep 15 09:47:48 EDT 2005 00011 // $Id: LoadAllDictionaries.cc,v 1.8 2007/04/13 11:05:43 wmtan Exp $ 00012 // 00013 00014 // system include files 00015 #include "Cintex/Cintex.h" 00016 00017 // user include files 00018 #include "FWCore/Services/src/LoadAllDictionaries.h" 00019 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00020 #include "FWCore/PluginManager/interface/PluginManager.h" 00021 #include "FWCore/PluginManager/interface/PluginCapabilities.h" 00022 00023 // 00024 // constants, enums and typedefs 00025 // 00026 00027 // 00028 // static data member definitions 00029 // 00030 00031 // 00032 // constructors and destructor 00033 // 00034 edm::service::LoadAllDictionaries::LoadAllDictionaries(const edm::ParameterSet& iConfig) 00035 { 00036 bool doLoad(iConfig.getUntrackedParameter("doLoad",true)); 00037 if(doLoad) { 00038 ROOT::Cintex::Cintex::Enable(); 00039 00040 edmplugin::PluginManager*db = edmplugin::PluginManager::get(); 00041 00042 typedef edmplugin::PluginManager::CategoryToInfos CatToInfos; 00043 00044 CatToInfos::const_iterator itFound = db->categoryToInfos().find("Capability"); 00045 00046 if(itFound == db->categoryToInfos().end()) { 00047 return; 00048 } 00049 std::string lastClass; 00050 const std::string cPrefix("LCGReflex/"); 00051 const std::string mystring("edm::Wrapper"); 00052 00053 for (edmplugin::PluginManager::Infos::const_iterator itInfo = itFound->second.begin(), 00054 itInfoEnd = itFound->second.end(); 00055 itInfo != itInfoEnd; ++itInfo) 00056 { 00057 if (lastClass == itInfo->name_) { 00058 continue; 00059 } 00060 00061 lastClass = itInfo->name_; 00062 if (lastClass.find(mystring) != std::string::npos) { 00063 edmplugin::PluginCapabilities::get()->load(lastClass); 00064 } 00065 //NOTE: since we have the library already, we could be more efficient if we just load it ourselves 00066 } 00067 } 00068 } 00069