@@ -205,25 +205,32 @@ void AnalysisSupportHelpers::addMissingOutputsToAnalysisCCDBFetcher(
205205 std::vector<InputSpec>& requestedDYNs,
206206 DataProcessorSpec& publisher)
207207{
208+ requestedSpecials |
209+ std::views::transform ([](auto const & req){ // create outputspecs for inputs
210+ return DataSpecUtils::asOutputSpec (req);
211+ }) |
212+ sinks::append_to{publisher.outputs }; // append them to the publisher outputs
213+
214+ std::vector<InputSpec> additionalInputs;
208215 for (auto & input : requestedSpecials) {
209- auto concrete = DataSpecUtils::asConcreteDataMatcher (input);
210- publisher.outputs .emplace_back (concrete.origin , concrete.description , concrete.subSpec );
211- // FIXME: good enough for now...
212- for (auto & i : input.metadata ) {
213- if ((i.type == VariantType::String) && (i.name .find (" input:" ) != std::string::npos)) {
214- auto spec = DataSpecUtils::fromMetadataString (i.defaultValue .get <std::string>());
215- auto j = std::find_if (publisher.inputs .begin (), publisher.inputs .end (), [&](auto x) { return x.binding == spec.binding ; });
216- if (j == publisher.inputs .end ()) {
217- publisher.inputs .push_back (spec);
218- }
219- if (DataSpecUtils::partialMatch (spec, AODOrigins)) {
220- DataSpecUtils::updateInputList (requestedAODs, std::move (spec));
221- } else if (DataSpecUtils::partialMatch (spec, header::DataOrigin{" DYN" })) {
222- DataSpecUtils::updateInputList (requestedDYNs, std::move (spec));
223- }
224- }
225- }
216+ input.metadata |
217+ std::views::filter ([](auto const & param){ // filter config params that are strings starting with "input:"
218+ return (param.type == VariantType::String) && (param.name .find (" input:" ) != std::string::npos);
219+ }) |
220+ std::views::transform ([](auto const & param){ // parse them into InputSpecs
221+ return DataSpecUtils::fromMetadataString (param.defaultValue .template get <std::string>());
222+ }) |
223+ sinks::update_input_list{additionalInputs}; // store into a temporary
226224 }
225+
226+ additionalInputs | sinks::update_input_list (publisher.inputs ); // update publisher inputs
227+ // FIXME: until we have a single list of pairs
228+ additionalInputs |
229+ views::partial_match_filter (AODOrigins) |
230+ sinks::update_input_list{requestedAODs}; // update requestedAODs
231+ additionalInputs |
232+ views::partial_match_filter (header::DataOrigin{" DYN" }) |
233+ sinks::update_input_list{requestedDYNs}; // update requestedDYNs
227234}
228235
229236// =============================================================================
0 commit comments