11 #ifndef MERGING_TRANSFORMER_H
12 #define MERGING_TRANSFORMER_H
25 using details::vector_of_const_;
29 template <
typename Sig>
31 template <
typename... Args>
33 template <
typename Sig>
36 template <
typename Signature,
typename Traits_,
bool isLegacy>
40 template <
typename Out,
typename In,
typename Traits_>
47 using KeyValue =
typename base_class::KeyValue;
52 , m_inputLocations{
this, inputs.first, inputs.second,
56 if ( std::is_pointer_v<In> ) {
60 [](
auto&
h ) { h.setOptional( true ); } );
64 static_assert( std::is_void_v<Out> );
69 , m_inputLocations{
this, inputs.first, inputs.second,
73 if ( std::is_pointer_v<In> ) {
77 [](
auto&
h ) { h.setOptional( true ); } );
81 static_assert( !std::is_void_v<Out> );
94 if constexpr ( std::is_void_v<Out> ) {
95 std::as_const ( *
this )( std::as_const( ins ) );
97 put( std::get<0>( this->m_outputs ), std::as_const( *
this )( std::as_const( ins ) ) );
110 template <
typename T>
118 template <
typename Out,
typename In,
typename Traits_>
130 , m_inputLocations{
this, inputs.first, inputs.second,
134 if ( std::is_pointer_v<In> ) {
138 [](
auto&
h ) { h.setOptional( true ); } );
142 static_assert( std::is_void_v<Out> );
147 , m_inputLocations{
this, inputs.first, inputs.second,
151 if ( std::is_pointer_v<In> ) {
155 [](
auto&
h ) { h.setOptional( true ); } );
159 static_assert( !std::is_void_v<Out> );
169 ins.
reserve( m_inputs.size() );
172 if constexpr ( std::is_void_v<Out> ) {
173 ( *this )( std::as_const( ins ) );
175 put( std::get<0>( this->m_outputs ), ( *
this )( std::as_const( ins ) ) );
188 template <
typename T>
198 template <
typename Signature,
typename Traits_ = Traits::useDefaults>
203 typename = std::enable_if_t<details::is_void_fun_v<Signature>>>
207 template <
typename Signature,
typename Traits_ = Traits::BaseClass_t<Gaudi::Algorithm>>
210 template <
typename... Outs,
typename In,
typename Traits_>
232 ins.
reserve( m_inputs.size() );
237 [&](
auto&... outhandle ) {
240 [&outhandle...](
auto&&... data ) {
241 ( details::put( outhandle, std::forward<decltype( data )>( data ) ), ... );
243 std::as_const( *
this )( std::as_const( ins ) ) );
258 template <
typename T>
266 template <
typename... Outs,
typename In,
typename Traits_>
269 : base_class(
name, pSvcLocator, outputs )
271 this, inputs.first, inputs.second,
274 if ( std::is_pointer_v<In> ) {
277 std::for_each( this->m_inputs.begin(), this->m_inputs.end(), [](
auto&
h ) { h.setOptional( true ); } );
283 template <
typename Signature,
typename Traits_ = Traits::BaseClass_t<Gaudi::Algorithm>>
286 template <
typename... Outs,
typename In,
typename Traits_>
308 ins.
reserve( m_inputs.size() );
313 [&](
auto&... outhandle ) {
316 [&outhandle...](
bool passed,
auto&&... data ) {
317 ( details::put( outhandle, std::forward<decltype( data )>( data ) ), ... );
320 ( *
this )( std::as_const( ins ) ) );
336 template <
typename T>
344 template <
typename... Outs,
typename In,
typename Traits_>
348 KeyValues
const& inputs,
349 OutKeys
const& outputs )
350 : base_class(
name, pSvcLocator, outputs )
352 this, inputs.first, inputs.second,
355 if ( std::is_pointer_v<In> ) {
358 std::for_each( this->m_inputs.begin(), this->m_inputs.end(), [](
auto&
h ) { h.setOptional( true ); } );