Skip to content

Commit 7122851

Browse files
authored
DPL Analysis: add ability to have ConfigurableGroup produce prefixed options (#13006)
1 parent 433dad6 commit 7122851

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Framework/Core/include/Framework/AnalysisManagers.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,15 @@ struct OptionManager {
532532
{
533533
/// Recurse, in case we are brace constructible
534534
if constexpr (std::is_base_of_v<ConfigurableGroup, ANY>) {
535+
if constexpr (requires { x.prefix; }) {
536+
homogeneous_apply_refs<true>([prefix = x.prefix]<typename C>(C& y) { // apend group prefix if set
537+
if constexpr (requires { y.name; }) {
538+
y.name = prefix + "." + y.name;
539+
}
540+
return true;
541+
},
542+
x);
543+
}
535544
homogeneous_apply_refs<true>([&options](auto& y) { return OptionManager<std::decay_t<decltype(y)>>::appendOption(options, y); }, x);
536545
return true;
537546
} else {

Framework/Core/test/test_AnalysisTask.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,11 @@ struct TestCCDBObject {
132132

133133
struct KTask {
134134
struct : public ConfigurableGroup {
135+
std::string prefix = "foo";
135136
Configurable<int> anInt{"someConfigurable", {}, "Some Configurable Object"};
136137
Configurable<int> anotherInt{"someOtherConfigurable", {}, "Some Configurable Object"};
137138
} foo;
139+
138140
Configurable<int> anThirdInt{"someThirdConfigurable", {}, "Some Configurable Object"};
139141
struct : public ConditionGroup {
140142
Condition<TestCCDBObject> test{"path"};

0 commit comments

Comments
 (0)