From 0dd0b8a52a0bfb31865fccaa89083b807b9b6307 Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Tue, 12 Aug 2025 18:24:02 +0200 Subject: [PATCH] DPL: add C++20 ranges views to filter vectors of InputSpecs / OutputSpecs --- .../Core/include/Framework/DataSpecViews.h | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Framework/Core/include/Framework/DataSpecViews.h diff --git a/Framework/Core/include/Framework/DataSpecViews.h b/Framework/Core/include/Framework/DataSpecViews.h new file mode 100644 index 0000000000000..010d771b07941 --- /dev/null +++ b/Framework/Core/include/Framework/DataSpecViews.h @@ -0,0 +1,25 @@ +// Copyright 2019-2025 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +#ifndef O2_FRAMEWORK_DATASPECVIEWS_H_ +#define O2_FRAMEWORK_DATASPECVIEWS_H_ + +#include "Framework/DataSpecUtils.h" +#include + +namespace o2::framework::views +{ +static auto partial_match_filter(auto what) +{ + return std::views::filter([&what](auto const& t) -> bool { return DataSpecUtils::partialMatch(t, what); }); +} +} // namespace o2::framework::views + +#endif // O2_FRAMEWORK_DATASPECVIEWS_H_