The Gaudi Framework  v41r0 (bdbe7744)
Loading...
Searching...
No Matches
Gaudi::Functional::ScalarTransformer< ScalarOp, Out(const In &...), Traits_ > Class Template Reference

#include </builds/gaudi/Gaudi/GaudiFunctional/include/Gaudi/Functional/ScalarTransformer.h>

Inheritance diagram for Gaudi::Functional::ScalarTransformer< ScalarOp, Out(const In &...), Traits_ >:
Collaboration diagram for Gaudi::Functional::ScalarTransformer< ScalarOp, Out(const In &...), Traits_ >:

Public Member Functions

Out operator() (const In &... in) const override final
 The main operator.

Private Member Functions

const ScalarOp & scalarOp () const
 Access the scalar operator.

Detailed Description

template<typename ScalarOp, typename Out, typename... In, typename Traits_>
class Gaudi::Functional::ScalarTransformer< ScalarOp, Out(const In &...), Traits_ >

Definition at line 27 of file ScalarTransformer.h.

Member Function Documentation

◆ operator()()

template<typename ScalarOp, typename Out, typename... In, typename Traits_>
Out Gaudi::Functional::ScalarTransformer< ScalarOp, Out(const In &...), Traits_ >::operator() ( const In &... in) const
inlinefinaloverride

The main operator.

Call the scalar operator with the objects obtained from the given tuple as arguments

Definition at line 36 of file ScalarTransformer.h.

36 {
37 const auto inrange = details::zip::range( in... );
38 Out out;
39 out.reserve( inrange.size() );
40 auto& scalar = scalarOp();
41 for ( const auto& tuple : inrange ) {
44 [&out]( auto&& arg ) { details::insert( out, std::forward<decltype( arg )>( arg ) ); },
45 std::apply( [&]( const auto&... i ) { return scalar( details::deref( i )... ); }, tuple ) );
46 }
48 return out;
49 }
decltype(auto) range(Args &&... args)
Zips multiple containers together to form a single range.
Definition zip.h:67
void applyPostProcessing(const Fun &fun, Container &c)
constexpr struct Gaudi::Functional::details::insert_t insert
constexpr struct Gaudi::Functional::details::invoke_optionally_t invoke_optionally

◆ scalarOp()

template<typename ScalarOp, typename Out, typename... In, typename Traits_>
const ScalarOp & Gaudi::Functional::ScalarTransformer< ScalarOp, Out(const In &...), Traits_ >::scalarOp ( ) const
inlineprivate

Access the scalar operator.

Definition at line 30 of file ScalarTransformer.h.

30{ return static_cast<const ScalarOp&>( *this ); }

The documentation for this class was generated from the following file: