The Gaudi Framework  master (e98cfcff)
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"
14
16
17 namespace details {
18
19 template <typename Signature, typename Traits_, bool isLegacy>
20 struct Consumer;
21
22 template <typename... In, typename Traits_>
23 struct Consumer<void( const In&... ), Traits_, true> : DataHandleMixin<type_list<>, type_list<In...>, Traits_> {
25
26 // derived classes are NOT allowed to implement execute ...
27 StatusCode execute() override final { return execute_single_output( *this, this->getContext() ); }
28
29 // ... instead, they must implement the following operator
30 virtual void operator()( const In&... ) const = 0;
31 };
32
33 template <typename... In, typename Traits_>
34 struct Consumer<void( const In&... ), Traits_, false> : DataHandleMixin<type_list<>, type_list<In...>, Traits_> {
36
37 // derived classes are NOT allowed to implement execute ...
38 StatusCode execute( const EventContext& ctx ) const override final { return execute_single_output( *this, ctx ); }
39
40 // ... instead, they must implement the following operator
41 virtual void operator()( const In&... ) const = 0;
42 };
43
44 } // namespace details
45
46 template <typename Signature, typename Traits_ = Traits::useDefaults>
48
49} // 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_single_output(const Algorithm &algo, const EventContext &ctx, const OutHandles &out_handles={})
Definition details.h:952
details::Consumer< Signature, Traits_, details::isLegacy< Traits_ > > Consumer
Definition Consumer.h:47
StatusCode execute(const EventContext &ctx) const override final
Definition Consumer.h:38