Project
Loading...
Searching...
No Matches
DataSpecViews.h
Go to the documentation of this file.
1
// Copyright 2019-2025 CERN and copyright holders of ALICE O2.
2
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3
// All rights not expressly granted are reserved.
4
//
5
// This software is distributed under the terms of the GNU General Public
6
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7
//
8
// In applying this license CERN does not waive the privileges and immunities
9
// granted to it by virtue of its status as an Intergovernmental Organization
10
// or submit itself to any jurisdiction.
11
#ifndef O2_FRAMEWORK_DATASPECVIEWS_H_
12
#define O2_FRAMEWORK_DATASPECVIEWS_H_
13
14
#include "
Framework/DataSpecUtils.h
"
15
#include <ranges>
16
17
namespace
o2::framework::views
18
{
19
static
auto
partial_match_filter(
auto
what)
20
{
21
return
std::views::filter([what](
auto
const
& t) ->
bool
{
return
DataSpecUtils::partialMatch
(t, what); });
22
}
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
34
}
// 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
66
67
#endif
// O2_FRAMEWORK_DATASPECVIEWS_H_
DataSpecUtils.h
output
void output(const std::map< std::string, ChannelStat > &channels)
Definition
rawdump.cxx:197
R
name
GLuint const GLchar * name
Definition
glcorearb.h:781
r
GLboolean r
Definition
glcorearb.h:1233
o2::framework::sinks
Definition
DataSpecViews.h:37
o2::framework::views
Definition
DataSpecViews.h:18
o2::framework::DataSpecUtils::partialMatch
static bool partialMatch(InputSpec const &spec, o2::header::DataOrigin const &origin)
Definition
DataSpecUtils.cxx:277
o2::framework::DataSpecUtils::updateInputList
static void updateInputList(std::vector< InputSpec > &list, InputSpec &&input)
Updates list of InputSpecs by merging metadata.
Definition
DataSpecUtils.cxx:775
o2::framework::sinks::append_to
Definition
DataSpecViews.h:39
o2::framework::sinks::append_to::c
Container & c
Definition
DataSpecViews.h:40
o2::framework::sinks::append_to::operator|
friend Container & operator|(R &&r, append_to self)
Definition
DataSpecViews.h:43
o2::framework::sinks::update_input_list
Definition
DataSpecViews.h:51
o2::framework::sinks::update_input_list::c
Container & c
Definition
DataSpecViews.h:52
o2::framework::sinks::update_input_list::operator|
friend Container & operator|(R &&r, update_input_list self)
Definition
DataSpecViews.h:55
Framework
Core
include
Framework
DataSpecViews.h
Generated on Fri Sep 5 2025 14:54:36 for Project by
1.9.8