Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fixes for new PluginDescription code #24797

Merged
merged 1 commit into from Oct 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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