CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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  LoadAllDictionaries(const LoadAllDictionaries&) = delete; // stop default
36  const LoadAllDictionaries& operator=(const LoadAllDictionaries&) = delete; // stop default
37 
38  //virtual ~LoadAllDictionaries();
39 
40  // ---------- const member functions ---------------------
41 
42  // ---------- static member functions --------------------
43  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
44 
45  // ---------- member functions ---------------------------
46 
47  private:
48  // ---------- member data --------------------------------
49  };
50  } // namespace service
51 } // namespace edm
52 
53 //
54 // constants, enums and typedefs
55 //
56 
57 //
58 // static data member definitions
59 //
60 
61 //
62 // constructors and destructor
63 //
65  bool doLoad(iConfig.getUntrackedParameter<bool>("doLoad"));
66  if (doLoad) {
68 
70 
71  CatToInfos::const_iterator itFound = db->categoryToInfos().find("Capability");
72 
73  if (itFound == db->categoryToInfos().end()) {
74  return;
75  }
76  std::string lastClass;
77  const std::string mystring("edm::Wrapper");
78 
79  for (edmplugin::PluginManager::Infos::const_iterator itInfo = itFound->second.begin(),
80  itInfoEnd = itFound->second.end();
81  itInfo != itInfoEnd;
82  ++itInfo) {
83  if (lastClass == itInfo->name_) {
84  continue;
85  }
86 
87  lastClass = itInfo->name_;
88  if (lastClass.find(mystring) != std::string::npos) {
90  }
91  //NOTE: since we have the library already, we could be more efficient if we just load it ourselves
92  }
93  }
94 }
95 
98  desc.addUntracked<bool>("doLoad", true)->setComment("Only if 'true' do we load all dictionaries");
99  descriptions.add("LoadAllDictionaries", desc);
100  descriptions.setComment(
101  "This service allows you to force all known dictionaries to be loaded at the beginning of the job");
102 }
103 
const CategoryToInfos & categoryToInfos() const
Definition: PluginManager.h:82
T getUntrackedParameter(std::string const &, T const &) const
#define DEFINE_FWK_SERVICE_MAKER(concrete, maker)
Definition: ServiceMaker.h:100
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::map< std::string, Infos > CategoryToInfos
Definition: PluginManager.h:51
tuple db
Definition: EcalCondDB.py:153
static PluginCapabilities * get()
const LoadAllDictionaries & operator=(const LoadAllDictionaries &)=delete
void setComment(std::string const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void load(const std::string &iName)
LoadAllDictionaries(const edm::ParameterSet &)
static PluginManager * get()