CMS 3D CMS Logo

LoadAllDictionaries.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Services
4 // Class : LoadAllDictionaries
5 //
14 //
15 // Original Author: Chris Jones
16 // Created: Thu Sep 15 09:47:48 EDT 2005
17 //
18 
19 // system include files
20 
21 // user include files
23 
29 
30 namespace edm {
31  namespace service {
33  public:
35  //virtual ~LoadAllDictionaries();
36 
37  // ---------- const member functions ---------------------
38 
39  // ---------- static member functions --------------------
40  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
41 
42  // ---------- member functions ---------------------------
43 
44  private:
45  LoadAllDictionaries(const LoadAllDictionaries&) = delete; // stop default
46 
47  const LoadAllDictionaries& operator=(const LoadAllDictionaries&) = delete; // stop default
48 
49  // ---------- member data --------------------------------
50  };
51  } // namespace service
52 } // namespace edm
53 
54 //
55 // constants, enums and typedefs
56 //
57 
58 //
59 // static data member definitions
60 //
61 
62 //
63 // constructors and destructor
64 //
66  bool doLoad(iConfig.getUntrackedParameter<bool>("doLoad"));
67  if (doLoad) {
69 
71 
72  CatToInfos::const_iterator itFound = db->categoryToInfos().find("Capability");
73 
74  if (itFound == db->categoryToInfos().end()) {
75  return;
76  }
77  std::string lastClass;
78  const std::string mystring("edm::Wrapper");
79 
80  for (edmplugin::PluginManager::Infos::const_iterator itInfo = itFound->second.begin(),
81  itInfoEnd = itFound->second.end();
82  itInfo != itInfoEnd;
83  ++itInfo) {
84  if (lastClass == itInfo->name_) {
85  continue;
86  }
87 
88  lastClass = itInfo->name_;
89  if (lastClass.find(mystring) != std::string::npos) {
91  }
92  //NOTE: since we have the library already, we could be more efficient if we just load it ourselves
93  }
94  }
95 }
96 
99  desc.addUntracked<bool>("doLoad", true)->setComment("Only if 'true' do we load all dictionaries");
100  descriptions.add("LoadAllDictionaries", desc);
101  descriptions.setComment(
102  "This service allows you to force all known dictionaries to be loaded at the beginning of the job");
103 }
104 
const CategoryToInfos & categoryToInfos() const
Definition: PluginManager.h:83
T getUntrackedParameter(std::string const &, T const &) const
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::map< std::string, Infos > CategoryToInfos
Definition: PluginManager.h:54
#define DEFINE_FWK_SERVICE_MAKER(concrete, maker)
Definition: ServiceMaker.h:109
static PluginCapabilities * get()
const LoadAllDictionaries & operator=(const LoadAllDictionaries &)=delete
void setComment(std::string const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
HLT enums.
void load(const std::string &iName)
LoadAllDictionaries(const edm::ParameterSet &)
static PluginManager * get()