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>
237 template <details::is_
void_fun Signature,
typename Traits_ = Traits::useDefaults>
241 template <
typename Signature,
typename Traits_ = Traits::BaseClass_t<Gaudi::Algorithm>>
244 template <
typename... Outs,
typename... Ins,
typename Traits_>
256 static constexpr
size_t n_args =
sizeof...( Ins );
260 , m_inputLocations{ details::for_<n_args>( [&](
auto I ) {
261 constexpr
auto i = decltype( I )::value;
262 auto& ins = std::get<i>( inputs );
266 auto& handles = std::get<i>( this->m_inputs );
267 auto& ins = std::get<i>( this->m_inputLocations );
268 using In =
typename std::decay_t<decltype( handles )>::value_type;
270 if ( std::is_pointer_v<In> ) {
273 std::for_each( handles.begin(), handles.end(), [](
auto&
h ) { h.setOptional( true ); } );
281 static_assert(
sizeof...( Ins ) == 1 );
286 return m_inputLocations.
at( i ).value().at(
j ).key();
289 static_assert( n_args == 1 );
290 return inputLocation( 0,
j );
292 unsigned int inputLocationSize(
int i = 0 )
const {
return m_inputLocations.at( i ).value().size(); }
298 constexpr
size_t i = decltype( I )::value;
299 auto& ins = std::get<i>( inss );
300 auto& handles = std::get<i>( m_inputs );
301 ins.reserve( handles.size() );
307 [&](
auto&... outhandle ) {
310 [&outhandle...](
auto&&... data ) {
311 ( details::put( outhandle, std::forward<decltype( data )>( data ) ), ... );
313 std::apply( [&](
auto&&... ins ) { return std::as_const( *this )( std::as_const( ins )... ); },
329 template <
typename T>
339 template <
typename Signature,
typename Traits_ = Traits::BaseClass_t<Gaudi::Algorithm>>
342 template <
typename... Outs,
typename In,
typename Traits_>
364 ins.
reserve( m_inputs.size() );
369 [&](
auto&... outhandle ) {
372 [&outhandle...](
bool passed,
auto&&... data ) {
373 ( details::put( outhandle, std::forward<decltype( data )>( data ) ), ... );
376 ( *
this )( std::as_const( ins ) ) );
392 template <
typename T>
400 template <
typename... Outs,
typename In,
typename Traits_>
404 KeyValues
const& inputs,
405 OutKeys
const& outputs )
406 : base_class(
name, pSvcLocator, outputs )
411 if ( std::is_pointer_v<In> ) {
414 std::for_each( this->m_inputs.begin(), this->m_inputs.end(), [](
auto&
h ) { h.setOptional( true ); } );