The Gaudi Framework
master (b9786168)
Loading...
Searching...
No Matches
Consumer.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2024 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
13
#include "
details.h
"
14
#include "
utilities.h
"
15
#include <
GaudiKernel/FunctionalFilterDecision.h
>
16
17
#include <tuple>
18
19
namespace
Gaudi::Functional
{
20
21
namespace
details
{
22
23
template
<
typename
Signature,
typename
Traits_,
bool
isLegacy>
24
struct
Consumer
;
25
26
template
<
typename
... In,
typename
Traits_>
27
struct
Consumer
<void( const In&... ), Traits_,
true
>
28
:
DataHandleMixin
<
std
::tuple<>,
filter_evtcontext
<In...>, Traits_> {
29
using
DataHandleMixin
<std::tuple<>,
filter_evtcontext
<In...>, Traits_>
::DataHandleMixin
;
30
31
// derived classes are NOT allowed to implement execute ...
32
StatusCode
execute
() override final {
33
try
{
34
filter_evtcontext_t<In...>::apply
( *
this
, this->m_inputs );
35
return
FilterDecision::PASSED
;
36
}
catch
(
GaudiException
& e ) {
37
if
( e.
code
().
isFailure
() ) this->error() << e.
tag
() <<
" : "
<< e.
message
() <<
endmsg
;
38
return
e.
code
();
39
}
40
}
41
42
// ... instead, they must implement the following operator
43
virtual
void
operator()
(
const
In&... )
const
= 0;
44
};
45
46
template
<
typename
... In,
typename
Traits_>
47
struct
Consumer
<void( const In&... ), Traits_,
false
>
48
:
DataHandleMixin
<
std
::tuple<>,
filter_evtcontext
<In...>, Traits_> {
49
using
DataHandleMixin
<std::tuple<>,
filter_evtcontext
<In...>, Traits_>
::DataHandleMixin
;
50
51
// derived classes are NOT allowed to implement execute ...
52
StatusCode
execute
(
const
EventContext
& ctx )
const
override
final
{
53
try
{
54
filter_evtcontext_t<In...>::apply
( *
this
, ctx, this->m_inputs );
55
return
FilterDecision::PASSED
;
56
}
catch
(
GaudiException
& e ) {
57
if
( e.
code
().
isFailure
() ) this->error() << e.
tag
() <<
" : "
<< e.
message
() <<
endmsg
;
58
return
e.
code
();
59
}
60
}
61
62
// ... instead, they must implement the following operator
63
virtual
void
operator()
(
const
In&... )
const
= 0;
64
};
65
66
}
// namespace details
67
68
template
<
typename
Signature,
typename
Traits_ = Traits::useDefaults>
69
using
Consumer
=
details::Consumer<Signature, Traits_, details::isLegacy<Traits_>
>;
70
71
}
// namespace Gaudi::Functional
FunctionalFilterDecision.h
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition
MsgStream.h:198
EventContext
This class represents an entry point to all the event specific data.
Definition
EventContext.h:35
Gaudi::Functional::details::DataHandleMixin
Definition
details.h:537
GaudiException
Define general base for Gaudi exception.
Definition
GaudiException.h:29
GaudiException::message
virtual const std::string & message() const
error message to be printed
Definition
GaudiException.h:66
GaudiException::code
virtual const StatusCode & code() const
StatusCode for Exception.
Definition
GaudiException.h:84
GaudiException::tag
virtual const std::string & tag() const
name tag for the exception, or exception type
Definition
GaudiException.h:75
StatusCode
This class is used for returning status codes from appropriate routines.
Definition
StatusCode.h:64
StatusCode::isFailure
bool isFailure() const
Definition
StatusCode.h:129
details.h
Gaudi::Functional::details::filter_evtcontext
typename filter_evtcontext_t< In... >::type filter_evtcontext
Definition
details.h:534
Gaudi::Functional
Definition
Consumer.h:19
Gaudi::Functional::FilterDecision::PASSED
@ PASSED
Definition
FunctionalFilterDecision.h:18
Gaudi::Functional::Consumer
details::Consumer< Signature, Traits_, details::isLegacy< Traits_ > > Consumer
Definition
Consumer.h:69
details
Definition
AnyDataWrapper.h:19
std
STL namespace.
Gaudi::Functional::details::Consumer
Definition
Consumer.h:24
Gaudi::Functional::details::Consumer< void(const In &...), Traits_, false >::execute
StatusCode execute(const EventContext &ctx) const override final
Definition
Consumer.h:52
Gaudi::Functional::details::Consumer< void(const In &...), Traits_, false >::operator()
virtual void operator()(const In &...) const =0
Gaudi::Functional::details::Consumer< void(const In &...), Traits_, true >::execute
StatusCode execute() override final
Definition
Consumer.h:32
Gaudi::Functional::details::Consumer< void(const In &...), Traits_, true >::operator()
virtual void operator()(const In &...) const =0
Gaudi::Functional::details::filter_evtcontext_t::apply
static auto apply(const Algorithm &algo, const EventContext &ctx, Handles &handles)
Definition
details.h:504
utilities.h
GaudiFunctional
include
Gaudi
Functional
Consumer.h
Generated on Tue Oct 28 2025 17:49:22 for The Gaudi Framework by
1.13.1