23 using details::vector_of_const_;
26 template <
typename F,
size_t... Is>
27 auto for_impl( F&& f, std::index_sequence<Is...> ) {
35 template <auto N,
typename F>
36 decltype(
auto )
for_( F&& f ) {
37 return for_impl( std::forward<F>( f ), std::make_index_sequence<N>{} );
40 template <
typename Sig>
42 template <
typename... Args>
44 template <
typename Sig>
47 template <
typename Signature,
typename Traits_,
bool isLegacy>
51 template <
typename Out,
typename In,
typename Traits_>
58 using KeyValue =
typename base_class::KeyValue;
67 if ( std::is_pointer_v<In> ) {
71 [](
auto&
h ) { h.setOptional( true ); } );
75 static_assert( std::is_void_v<Out> );
84 if ( std::is_pointer_v<In> ) {
88 [](
auto&
h ) { h.setOptional( true ); } );
92 static_assert( !std::is_void_v<Out> );
102 ins.
reserve( m_inputs.size() );
105 if constexpr ( std::is_void_v<Out> ) {
106 std::as_const ( *
this )( std::as_const( ins ) );
108 put( std::get<0>( this->m_outputs ), std::as_const( *
this )( std::as_const( ins ) ) );
121 template <
typename T>
129 template <
typename Out,
typename... Ins,
typename Traits_>
141 constexpr
auto i = decltype( I )::value;
142 auto& ins = std::get<i>( inputs );
146 auto& handles = std::get<i>( this->m_inputs );
147 auto& ins = std::get<i>( this->m_inputLocations );
148 using Handles =
typename std::decay_t<decltype( handles )>;
149 handles = make_vector_of_handles<Handles>(
this, ins );
150 if ( std::is_pointer_v<typename Handles::value_type> ) {
154 std::for_each( handles.begin(), handles.end(), [](
auto&
h ) { h.setOptional( true ); } );
163 :
base_class(
std::move(
name ), locator ), m_inputLocations{ construct_properties( inputs ) } {
164 static_assert( std::is_void_v<Out> );
169 static_assert(
sizeof...( Ins ) == 1 );
174 static_assert( !std::is_void_v<Out> );
179 static_assert(
sizeof...( Ins ) == 1 );
184 return m_inputLocations.
at( i ).value().at(
j ).key();
187 static_assert(
sizeof...( Ins ) == 1 );
188 return inputLocation( 0, i );
190 unsigned int inputLocationSize(
int i = 0 )
const {
return m_inputLocations.at( i ).value().size(); }
196 constexpr
size_t i = decltype( I )::value;
197 auto& ins = std::get<i>( inss );
198 auto& handles = std::get<i>( m_inputs );
199 ins.reserve( handles.size() );
204 if constexpr ( std::is_void_v<Out> ) {
205 std::apply( [&](
auto&&... ins ) {
return std::as_const( *
this )( std::as_const( ins )... ); }, inss );
207 put( std::get<0>( this->m_outputs ),
208 std::apply( [&](
auto&&... ins ) {
return std::as_const( *
this )( std::as_const( ins )... ); },
222 template <
typename T>
233 template <
typename Signature,
typename Traits_ = Traits::useDefaults>
238 typename = std::enable_if_t<details::is_void_fun_v<Signature>>>
242 template <
typename Signature,
typename Traits_ = Traits::BaseClass_t<Gaudi::Algorithm>>
245 template <
typename... Outs,
typename... Ins,
typename Traits_>
257 static constexpr
size_t n_args =
sizeof...( Ins );
261 , m_inputLocations{ details::for_<n_args>( [&](
auto I ) {
262 constexpr
auto i = decltype( I )::value;
263 auto& ins = std::get<i>( inputs );
267 auto& handles = std::get<i>( this->m_inputs );
268 auto& ins = std::get<i>( this->m_inputLocations );
269 using In =
typename std::decay_t<decltype( handles )>::value_type;
271 if ( std::is_pointer_v<In> ) {
274 std::for_each( handles.begin(), handles.end(), [](
auto&
h ) { h.setOptional( true ); } );
282 static_assert(
sizeof...( Ins ) == 1 );
287 return m_inputLocations.
at( i ).value().at(
j ).key();
290 static_assert( n_args == 1 );
291 return inputLocation( 0,
j );
293 unsigned int inputLocationSize(
int i = 0 )
const {
return m_inputLocations.at( i ).value().size(); }
299 constexpr
size_t i = decltype( I )::value;
300 auto& ins = std::get<i>( inss );
301 auto& handles = std::get<i>( m_inputs );
302 ins.reserve( handles.size() );
308 [&](
auto&... outhandle ) {
311 [&outhandle...](
auto&&... data ) {
312 ( details::put( outhandle, std::forward<decltype( data )>( data ) ), ... );
314 std::apply( [&](
auto&&... ins ) { return std::as_const( *this )( std::as_const( ins )... ); },
330 template <
typename T>
340 template <
typename Signature,
typename Traits_ = Traits::BaseClass_t<Gaudi::Algorithm>>
343 template <
typename... Outs,
typename In,
typename Traits_>
365 ins.
reserve( m_inputs.size() );
370 [&](
auto&... outhandle ) {
373 [&outhandle...](
bool passed,
auto&&... data ) {
374 ( details::put( outhandle, std::forward<decltype( data )>( data ) ), ... );
377 ( *
this )( std::as_const( ins ) ) );
393 template <
typename T>
401 template <
typename... Outs,
typename In,
typename Traits_>
405 KeyValues
const& inputs,
406 OutKeys
const& outputs )
407 : base_class(
name, pSvcLocator, outputs )
412 if ( std::is_pointer_v<In> ) {
415 std::for_each( this->m_inputs.begin(), this->m_inputs.end(), [](
auto&
h ) { h.setOptional( true ); } );