@@ -18,8 +18,50 @@ namespace o2::framework::views
1818{
1919static auto partial_match_filter (auto what)
2020{
21- return std::views::filter ([& what](auto const & t) -> bool { return DataSpecUtils::partialMatch (t, what); });
21+ return std::views::filter ([what](auto const & t) -> bool { return DataSpecUtils::partialMatch (t, what); });
2222}
23+
24+ static auto exclude_by_name (std::string name)
25+ {
26+ return std::views::filter ([name](auto const & t) -> bool { return t.name != name; });
27+ }
28+
29+ static auto filter_not_matching (auto const & provided)
30+ {
31+ return std::views::filter ([&provided](auto const & input) { return std::none_of (provided.begin (), provided.end (), [&input](auto const & output) { return DataSpecUtils::match (input, output); }); });
32+ }
33+
2334} // namespace o2::framework::views
35+ //
36+ namespace o2 ::framework::sinks
37+ {
38+ template <class Container >
39+ struct append_to {
40+ Container& c;
41+ // ends the pipeline, returns the container
42+ template <std::ranges::input_range R>
43+ friend Container& operator |(R&& r, append_to self)
44+ {
45+ std::ranges::copy (r, std::back_inserter (self.c ));
46+ return self.c ;
47+ }
48+ };
49+
50+ template <class Container >
51+ struct update_input_list {
52+ Container& c;
53+ // ends the pipeline, returns the container
54+ template <std::ranges::input_range R>
55+ friend Container& operator |(R&& r, update_input_list self)
56+ {
57+ for (auto & item : r) {
58+ auto copy = item;
59+ DataSpecUtils::updateInputList (self.c , std::move (copy));
60+ }
61+ return self.c ;
62+ }
63+ };
64+
65+ } // namespace o2::framework::sinks
2466
2567#endif // O2_FRAMEWORK_DATASPECVIEWS_H_
0 commit comments