Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "Cintex/Cintex.h"
00016
00017
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 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
00023 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 edm::service::LoadAllDictionaries::LoadAllDictionaries(const edm::ParameterSet& iConfig)
00037 {
00038 bool doLoad(iConfig.getUntrackedParameter<bool>("doLoad"));
00039 if(doLoad) {
00040 ROOT::Cintex::Cintex::Enable();
00041
00042 edmplugin::PluginManager*db = edmplugin::PluginManager::get();
00043
00044 typedef edmplugin::PluginManager::CategoryToInfos CatToInfos;
00045
00046 CatToInfos::const_iterator itFound = db->categoryToInfos().find("Capability");
00047
00048 if(itFound == db->categoryToInfos().end()) {
00049 return;
00050 }
00051 std::string lastClass;
00052 const std::string mystring("edm::Wrapper");
00053
00054 for (edmplugin::PluginManager::Infos::const_iterator itInfo = itFound->second.begin(),
00055 itInfoEnd = itFound->second.end();
00056 itInfo != itInfoEnd; ++itInfo)
00057 {
00058 if (lastClass == itInfo->name_) {
00059 continue;
00060 }
00061
00062 lastClass = itInfo->name_;
00063 if (lastClass.find(mystring) != std::string::npos) {
00064 edmplugin::PluginCapabilities::get()->load(lastClass);
00065 }
00066
00067 }
00068 }
00069 }
00070
00071 void edm::service::LoadAllDictionaries::fillDescriptions(edm::ConfigurationDescriptions & descriptions) {
00072 edm::ParameterSetDescription desc;
00073 desc.addUntracked<bool>("doLoad", true)->setComment("Only if 'true' do we load all dictionaries");
00074 descriptions.add("LoadAllDictionaries", desc);
00075 descriptions.setComment("This service allows you to force all known dictionaries to be loaded at the beginning of the job");
00076 }
00077