Skip to content

Commit d8d1cfa

Browse files
committed
add runtime output matcher to produces
1 parent faf2a4a commit d8d1cfa

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

Framework/Core/include/Framework/AnalysisHelpers.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,7 @@ struct WritingCursor {
483483
public:
484484
using persistent_table_t = decltype([]() { if constexpr (soa::is_iterator<T>) { return typename T::parent_t{nullptr}; } else { return T{nullptr}; } }());
485485
using cursor_t = decltype(std::declval<TableBuilder>().cursor<persistent_table_t>());
486+
OutputSpec outputSpec{soa::tableRef2OutputSpec<persistent_table_t::ref>()};
486487

487488
template <typename... Ts>
488489
void operator()(Ts&&... args)

Framework/Core/include/Framework/AnalysisManagers.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,9 @@ constexpr bool appendOutput(std::vector<OutputSpec>&, T&, uint32_t)
200200
}
201201

202202
template <is_produces T>
203-
constexpr bool appendOutput(std::vector<OutputSpec>& outputs, T&, uint32_t)
203+
constexpr bool appendOutput(std::vector<OutputSpec>& outputs, T& produces, uint32_t)
204204
{
205-
outputs.emplace_back(soa::tableRef2OutputSpec<T::persistent_table_t::ref>());
205+
outputs.emplace_back(produces.outputSpec);
206206
return true;
207207
}
208208

@@ -272,8 +272,8 @@ bool prepareOutput(ProcessingContext&, T&)
272272
template <is_produces T>
273273
bool prepareOutput(ProcessingContext& context, T& produces)
274274
{
275-
/// FIXME: use matcher instead of an OutputRef
276-
produces.resetCursor(std::move(context.outputs().make<TableBuilder>(soa::tableRef2OutputRef<T::persistent_table_t::ref>())));
275+
auto matcher = DataSpecUtils::asConcreteDataMatcher(produces.outputSpec);
276+
produces.resetCursor(std::move(context.outputs().make<TableBuilder>(Output{matcher.origin, matcher.description, matcher.subSpec})));
277277
return true;
278278
}
279279

@@ -306,7 +306,6 @@ bool prepareOutput(ProcessingContext& context, T& spawns)
306306
template <is_builds T>
307307
bool prepareOutput(ProcessingContext& context, T& builds)
308308
{
309-
using metadata = o2::aod::MetadataTrait<o2::aod::Hash<T::buildable_t::ref.desc_hash>>::metadata;
310309
return builds.build(framework::extractTablesFromRecord(context.inputs(), builds.requiredInputs | std::views::transform([](auto const& input){ return DataSpecUtils::asConcreteDataMatcher(input); }) ));
311310
}
312311

0 commit comments

Comments
 (0)