The Gaudi Framework
v41r0 (bdbe7744)
Toggle main menu visibility
Loading...
Searching...
No Matches
FilterPredicate.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2026 CERN for the benefit of the LHCb and ATLAS collaborations *
3
* *
4
* This software is distributed under the terms of the Apache version 2 licence, *
5
* copied verbatim in the file "LICENSE". *
6
* *
7
* In applying this licence, CERN does not waive the privileges and immunities *
8
* granted to it by virtue of its status as an Intergovernmental Organization *
9
* or submit itself to any jurisdiction. *
10
\***********************************************************************************/
11
#pragma once
12
#include "
details.h
"
13
#include "
utilities.h
"
14
15
namespace
Gaudi::Functional
{
16
17
namespace
details
{
18
19
template
<
typename
T,
typename
Traits_,
bool
isLegacy>
20
struct
FilterPredicate
;
21
22
template
<
typename
... In,
typename
Traits_,
bool
isLegacy
>
23
StatusCode
execute_filter_predicate
(
const
FilterPredicate
<
bool
(
const
In&... ), Traits_,
isLegacy
>& algo,
24
const
EventContext
& ctx ) {
25
return
details::execute
(
26
algo, [&] {
return
algo.invoke( algo, ctx ) ?
FilterDecision::PASSED
:
FilterDecision::FAILED
; } );
27
}
28
29
template
<
typename
... In,
typename
Traits_>
30
struct
FilterPredicate
<bool( const In&... ), Traits_,
true
>
31
:
DataHandleMixin
<
type_list
<>,
type_list
<In...>, Traits_> {
32
using
DataHandleMixin
<
type_list<>
,
type_list
<In...>, Traits_>
::DataHandleMixin
;
33
34
// derived classes are NOT allowed to implement execute ...
35
StatusCode
execute
() override final {
return
execute_filter_predicate
( *
this
, this->getContext() ); }
36
// ... instead, they must implement the following operator
37
virtual
bool
operator()
(
const
In&... )
const
= 0;
38
};
39
40
template
<
typename
... In,
typename
Traits_>
41
struct
FilterPredicate
<bool( const In&... ), Traits_,
false
>
42
:
DataHandleMixin
<
type_list
<>,
type_list
<In...>, Traits_> {
43
using
DataHandleMixin
<
type_list<>
,
type_list
<In...>, Traits_>
::DataHandleMixin
;
44
45
// derived classes are NOT allowed to implement execute ...
46
StatusCode
execute
(
const
EventContext
& ctx )
const
override
final
{
47
return
execute_filter_predicate
( *
this
, ctx );
48
}
49
50
// ... instead, they must implement the following operator
51
virtual
bool
operator()
(
const
In&... )
const
= 0;
52
};
53
54
}
// namespace details
55
56
template
<
typename
Signature,
typename
Traits_ = Traits::useDefaults>
57
using
FilterPredicate
=
details::FilterPredicate<Signature, Traits_, details::isLegacy<Traits_>
>;
58
59
}
// namespace Gaudi::Functional
EventContext
This class represents an entry point to all the event specific data.
Definition
EventContext.h:35
Gaudi::Functional::details::DataHandleMixin
Definition
deprecated.h:19
StatusCode
This class is used for returning status codes from appropriate routines.
Definition
StatusCode.h:64
details.h
Gaudi::Functional::details
Definition
Consumer.h:17
Gaudi::Functional::details::isLegacy
constexpr bool isLegacy
Definition
details.h:646
Gaudi::Functional::details::execute_filter_predicate
StatusCode execute_filter_predicate(const FilterPredicate< bool(const In &...), Traits_, isLegacy > &algo, const EventContext &ctx)
Definition
FilterPredicate.h:23
Gaudi::Functional::details::execute
StatusCode execute(CommonMessagingBase const &alg, F &&f)
Definition
details.h:398
Gaudi::Functional
Definition
Consumer.h:15
Gaudi::Functional::FilterDecision::PASSED
@ PASSED
Definition
FunctionalFilterDecision.h:18
Gaudi::Functional::FilterDecision::FAILED
@ FAILED
Definition
FunctionalFilterDecision.h:19
Gaudi::Functional::FilterPredicate
details::FilterPredicate< Signature, Traits_, details::isLegacy< Traits_ > > FilterPredicate
Definition
FilterPredicate.h:57
Gaudi::Functional::details::FilterPredicate< bool(const In &...), Traits_, false >::operator()
virtual bool operator()(const In &...) const =0
Gaudi::Functional::details::FilterPredicate< bool(const In &...), Traits_, false >::execute
StatusCode execute(const EventContext &ctx) const override final
Definition
FilterPredicate.h:46
Gaudi::Functional::details::FilterPredicate< bool(const In &...), Traits_, true >::execute
StatusCode execute() override final
Definition
FilterPredicate.h:35
Gaudi::Functional::details::FilterPredicate< bool(const In &...), Traits_, true >::operator()
virtual bool operator()(const In &...) const =0
Gaudi::Functional::details::FilterPredicate
Definition
FilterPredicate.h:20
Gaudi::Functional::details::type_list
Definition
details.h:383
utilities.h
GaudiFunctional
include
Gaudi
Functional
FilterPredicate.h
Generated on
for The Gaudi Framework by
1.17.0