The Gaudi Framework  master (e98cfcff)
Loading...
Searching...
No Matches
SplittingMergingTransformer.h
Go to the documentation of this file.
1/*****************************************************************************\
2* (c) Copyright 2022-2026 CERN for the benefit of the LHCb Collaboration *
3* *
4* This software is distributed under the terms of the GNU General Public *
5* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". *
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#include <optional>
15#include <vector>
16
17namespace Gaudi::Functional {
18 template <typename Container>
19 using vector_of_ = std::vector<Container>;
20 template <typename Container>
21 using vector_of_optional_ = std::vector<std::optional<Container>>;
23
24 namespace details {
25
26 template <typename Signature, typename Traits_>
28
29 template <typename Out, typename... Args, typename Traits_>
30 requires has_handle_vector_input<Args...>
31 struct SplittingMergingTransformer<vector_of_<Out>( const Args&... ), Traits_>
32 : DataHandleVectorMixin<type_list<vector_of_output_<Out>>, Traits_, Args...> {
34
35 // derived classes can NOT implement execute
36 StatusCode execute( const EventContext& ctx ) const override final {
37 return details::execute_single_output( *this, ctx, this->m_outputs );
38 }
39
40 // TODO/FIXME: how does the callee know in which order to produce the outputs?
41 // (note: 'missing' items can be specified by making Out an std::optional<Out>,
42 // and only those entries which contain an Out are stored)
43 virtual vector_of_<Out> operator()( const Args&... ) const = 0;
44 };
45
46 } // namespace details
47
48 template <typename Signature, typename Traits_ = Traits::useDefaults>
50
51} // 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
DataHandleMixin< Outputs, type_list< handle_vector_input_t< Args >... >, Traits_ > DataHandleVectorMixin
Definition details.h:752
std::vector< Container > vector_of_
details::SplittingMergingTransformer< Signature, Traits_ > SplittingMergingTransformer
std::vector< std::optional< Container > > vector_of_optional_