Skip to content

Commit

Permalink
Merge pull request #24797 from wddgit/pluginDescription
Browse files Browse the repository at this point in the history
Bug fixes for new PluginDescription code
  • Loading branch information
cmsbuild committed Oct 4, 2018
2 parents b95bac8 + 1d355b0 commit a7cdc74
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion FWCore/Integration/test/PluginUsingProducer.cc
Expand Up @@ -76,7 +76,7 @@ namespace edmtest {
putToken_{produces<int>()}
{
auto pluginPSet = pset.getParameter<edm::ParameterSet>("plugin");
maker_.reset( IntFactory::get()->create(pluginPSet.getParameter<std::string>("type"), pset));
maker_.reset( IntFactory::get()->create(pluginPSet.getParameter<std::string>("type"), pluginPSet));
}

void PluginUsingProducer::produce(edm::StreamID, edm::Event& event, edm::EventSetup const&) const{
Expand Down
13 changes: 10 additions & 3 deletions FWCore/ParameterSet/interface/PluginDescription.h
Expand Up @@ -183,8 +183,13 @@ template< typename T>

//loop over all possible plugins
unsigned int pluginCount = 0;
std::string previousName;
for(auto const& info: edmplugin::PluginManager::get()->categoryToInfos().find(Factory::get()->category())->second) {

// We only want to print the first instance of each plugin name
if (previousName == info.name_) {
continue;
}

std::stringstream ss;
ss << dfh.section() << "." << dfh.counter();
Expand All @@ -199,6 +204,8 @@ template< typename T>
new_dfh.setSection(newSection);

loadDescription(info.name_)->print(os,new_dfh);

previousName = info.name_;
}
}

Expand All @@ -215,12 +222,12 @@ template< typename T>
}

private:

std::string findType(edm::ParameterSet const& iPSet) const {
if(typeLabelIsTracked_) {
if(defaultType_.empty()) {
if(iPSet.existsAs<std::string>(typeLabel_) || defaultType_.empty()) {
return iPSet.getParameter<std::string>(typeLabel_);
}
if(not iPSet.existsAs<std::string>(typeLabel_) ) {
} else {
return defaultType_;
}
}
Expand Down

0 comments on commit a7cdc74

Please sign in to comment.