The Gaudi Framework  master (2e52acd2)
Loading...
Searching...
No Matches
Consumer.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"
15#include <tuple>
16
18
19 namespace details {
20
21 template <typename Signature, typename Traits_, bool isLegacy>
22 struct Consumer;
23
24 template <typename... In, typename Traits_>
25 struct Consumer<void( const In&... ), Traits_, true>
26 : DataHandleMixin<std::tuple<>, filter_evtcontext<In...>, Traits_> {
27 using DataHandleMixin<std::tuple<>, filter_evtcontext<In...>, Traits_>::DataHandleMixin;
28
29 // derived classes are NOT allowed to implement execute ...
30 StatusCode execute() override final {
31 return details::execute( *this, [&] {
34 } );
35 }
36
37 // ... instead, they must implement the following operator
38 virtual void operator()( const In&... ) const = 0;
39 };
40
41 template <typename... In, typename Traits_>
42 struct Consumer<void( const In&... ), Traits_, false>
43 : DataHandleMixin<std::tuple<>, filter_evtcontext<In...>, Traits_> {
44 using DataHandleMixin<std::tuple<>, filter_evtcontext<In...>, Traits_>::DataHandleMixin;
45
46 // derived classes are NOT allowed to implement execute ...
47 StatusCode execute( const EventContext& ctx ) const override final {
48 return details::execute( *this, [&] {
49 filter_evtcontext_t<In...>::apply( *this, ctx, this->m_inputs );
51 } );
52 }
53
54 // ... instead, they must implement the following operator
55 virtual void operator()( const In&... ) const = 0;
56 };
57
58 } // namespace details
59
60 template <typename Signature, typename Traits_ = Traits::useDefaults>
62
63} // namespace Gaudi::Functional
This class represents an entry point to all the event specific data.
This class is used for returning status codes from appropriate routines.
Definition StatusCode.h:64
StatusCode execute(CommonMessagingBase const &alg, F &&f)
Definition details.h:429
typename filter_evtcontext_t< In... >::type filter_evtcontext
Definition details.h:549
details::Consumer< Signature, Traits_, details::isLegacy< Traits_ > > Consumer
Definition Consumer.h:61
GAUDI_API const EventContext & currentContext()
STL namespace.
StatusCode execute(const EventContext &ctx) const override final
Definition Consumer.h:47
static auto apply(const Algorithm &algo, const EventContext &ctx, Handles &handles)
Definition details.h:529