The Gaudi Framework  master (37c0b60a)
Gaudi::Functional::details Namespace Reference

Namespaces

 detail2
 
 details2
 
 zip
 

Classes

struct  Consumer
 
struct  Consumer< void(const In &...), Traits_, false >
 
struct  Consumer< void(const In &...), Traits_, true >
 
class  DataHandleMixin
 
class  DataHandleMixin< std::tuple< Out... >, std::tuple< In... >, Traits_ >
 
class  DataHandleMixin< std::tuple< Out... >, std::tuple<>, Traits_ >
 
class  DataHandleMixin< std::tuple< void >, std::tuple<>, Traits_ >
 
class  DataHandleMixin< std::tuple<>, std::tuple< In... >, Traits_ >
 
class  DataHandleMixin< std::tuple<>, std::tuple<>, Traits_ >
 
struct  deref_t
 
struct  filter_evtcontext_t
 
struct  filter_evtcontext_t< EventContext, In... >
 
struct  FilterPredicate
 
struct  FilterPredicate< bool(const In &...), Traits_, false >
 
struct  FilterPredicate< bool(const In &...), Traits_, true >
 
struct  insert_t
 
struct  invoke_optionally_t
 
struct  is_void_fun
 
struct  is_void_fun< void(Args...)>
 
struct  MergingTransformer
 
struct  MergingTransformer< Out(const vector_of_const_< In > &), Traits_, true >
 
struct  MergingTransformer< Out(const vector_of_const_< Ins > &...), Traits_, false >
 
struct  Producer
 
class  SplittingMergingTransformer
 
class  SplittingMergingTransformer< vector_of_< Out >(const vector_of_const_< In > &), Traits_, false >
 
class  SplittingTransformer
 
class  SplittingTransformer< vector_of_< Out >(const In &...), Traits_, false >
 
class  SplittingTransformer< vector_of_< Out >(const In &...), Traits_, true >
 
class  ToolBinder
 
class  ToolBinder< Gaudi::Interface::Bind::Box< IFace >(Args const &...), Traits >
 
class  vector_of_const_
 

Typedefs

template<typename Arg >
using require_is_optional = std::enable_if_t< is_optional_v< Arg > >
 
template<typename Arg >
using require_is_not_optional = std::enable_if_t<!is_optional_v< Arg > >
 
template<typename T >
using remove_optional_t = std::conditional_t< is_optional_v< T >, Gaudi::cpp17::detected_t< details2::value_type_of_t, T >, T >
 
template<typename Value , auto N>
using RepeatValues_ = decltype(get_values_helper< Value >(std::make_index_sequence< N >()))
 
template<typename Tr , typename Base = Gaudi::Algorithm>
using BaseClass_t = Gaudi::cpp17::detected_or_t< Base, detail2::BaseClass_t, Tr >
 
template<typename Tr , typename T >
using OutputHandle_t = Gaudi::cpp17::detected_or_t< DataObjectWriteHandle< T >, detail2::OutputHandle_t, Tr, T >
 
template<typename Tr , typename T >
using InputHandle_t = Gaudi::cpp17::detected_or_t< detail2::DefaultInputHandle< T >, detail2::InputHandle_t, Tr, T >
 
template<typename... In>
using filter_evtcontext = typename filter_evtcontext_t< In... >::type
 

Functions

std::vector< DataObjIDto_DataObjID (const std::vector< std::string > &in)
 
template<typename Value , std::size_t... I>
auto get_values_helper (std::index_sequence< I... >)
 
template<typename Out1 , typename Out2 , typename = std::enable_if_t<std::is_constructible_v<Out1, Out2> && std::is_base_of_v<DataObject, Out1>>>
auto put (const DataObjectHandle< Out1 > &out_handle, Out2 &&out)
 
template<typename Out1 , typename Out2 , typename = std::enable_if_t<std::is_constructible_v<Out1, Out2>>>
auto put (const DataObjectHandle< AnyDataWrapper< Out1 >> &out_handle, Out2 &&out)
 
template<typename OutHandle , typename OptOut , typename = require_is_optional<OptOut>>
void put (const OutHandle &out_handle, OptOut &&out)
 
template<typename Handles >
Handles make_vector_of_handles (IDataHandleHolder *owner, const std::vector< DataObjID > &init)
 
template<typename Handle , typename Algo >
auto get (const Handle &handle, const Algo &, const EventContext &) -> decltype(details::deref(handle.get()))
 
template<typename IFace , typename Algo >
auto get (const ToolHandle< Gaudi::Interface::Bind::IBinder< IFace >> &handle, const Algo &, const EventContext &ctx)
 
template<typename Handle >
auto getKey (const Handle &h) -> decltype(h.objKey())
 
template<typename Out , typename In , typename Tr >
void updateHandleLocation (DataHandleMixin< Out, In, Tr > &parent, const std::string &prop, const std::string &newLoc)
 
template<typename Out , typename In , typename Tr >
void updateHandleLocations (DataHandleMixin< Out, In, Tr > &parent, const std::string &prop, const std::vector< std::string > &newLocs)
 
template<typename Fun , typename Container , typename... Args>
constexpr void applyPostProcessing (const Fun &, Container &, Args...)
 
template<typename Fun , typename Container >
auto applyPostProcessing (const Fun &fun, Container &c) -> decltype(fun.postprocess(c), void())
 
template<typename F , size_t... Is>
auto for_impl (F &&f, std::index_sequence< Is... >)
 
template<auto N, typename F >
decltype(auto) for_ (F &&f)
 

Variables

template<typename Arg >
constexpr bool is_optional_v = Gaudi::cpp17::is_detected_v<details2::is_optional_, Arg>
 
constexpr struct Gaudi::Functional::details::invoke_optionally_t invoke_optionally
 
constexpr struct Gaudi::Functional::details::insert_t insert
 
constexpr struct Gaudi::Functional::details::deref_t deref
 
template<typename Traits >
constexpr bool isLegacy
 
template<typename Sig >
constexpr bool is_void_fun_v = is_void_fun<Sig>::value
 

Typedef Documentation

◆ BaseClass_t

template<typename Tr , typename Base = Gaudi::Algorithm>
using Gaudi::Functional::details::BaseClass_t = typedef Gaudi::cpp17::detected_or_t<Base, detail2::BaseClass_t, Tr>

Definition at line 416 of file details.h.

◆ filter_evtcontext

template<typename... In>
using Gaudi::Functional::details::filter_evtcontext = typedef typename filter_evtcontext_t<In...>::type

Definition at line 503 of file details.h.

◆ InputHandle_t

Definition at line 425 of file details.h.

◆ OutputHandle_t

Definition at line 423 of file details.h.

◆ remove_optional_t

template<typename T >
using Gaudi::Functional::details::remove_optional_t = typedef std::conditional_t<is_optional_v<T>, Gaudi::cpp17::detected_t<details2::value_type_of_t, T>, T>

Definition at line 141 of file details.h.

◆ RepeatValues_

template<typename Value , auto N>
using Gaudi::Functional::details::RepeatValues_ = typedef decltype( get_values_helper<Value>( std::make_index_sequence<N>() ) )

Definition at line 162 of file details.h.

◆ require_is_not_optional

template<typename Arg >
using Gaudi::Functional::details::require_is_not_optional = typedef std::enable_if_t<!is_optional_v<Arg> >

Definition at line 138 of file details.h.

◆ require_is_optional

template<typename Arg >
using Gaudi::Functional::details::require_is_optional = typedef std::enable_if_t<is_optional_v<Arg> >

Definition at line 135 of file details.h.

Function Documentation

◆ applyPostProcessing() [1/2]

template<typename Fun , typename Container , typename... Args>
constexpr void Gaudi::Functional::details::applyPostProcessing ( const Fun &  ,
Container &  ,
Args...   
)
constexpr

Definition at line 701 of file details.h.

701  {
702  static_assert( sizeof...( Args ) == 0, "Args should not be used!" );
703  }

◆ applyPostProcessing() [2/2]

template<typename Fun , typename Container >
auto Gaudi::Functional::details::applyPostProcessing ( const Fun &  fun,
Container &  c 
) -> decltype( fun.postprocess( c ), void() )

Definition at line 706 of file details.h.

706  {
707  fun.postprocess( c );
708  }

◆ for_()

template<auto N, typename F >
decltype( auto ) Gaudi::Functional::details::for_ ( F &&  f)

Definition at line 36 of file MergingTransformer.h.

36  {
37  return for_impl( std::forward<F>( f ), std::make_index_sequence<N>{} );
38  }

◆ for_impl()

template<typename F , size_t... Is>
auto Gaudi::Functional::details::for_impl ( F &&  f,
std::index_sequence< Is... >   
)

Definition at line 27 of file MergingTransformer.h.

27  {
28  if constexpr ( std::disjunction_v<std::is_void<std::invoke_result_t<F, std::integral_constant<int, Is>>>...> ) {
29  ( std::invoke( f, std::integral_constant<int, Is>{} ), ... );
30  } else {
31  return std::array{ std::invoke( f, std::integral_constant<int, Is>{} )... };
32  }
33  }

◆ get() [1/2]

template<typename Handle , typename Algo >
auto Gaudi::Functional::details::get ( const Handle &  handle,
const Algo &  ,
const EventContext  
) -> decltype( details::deref( handle.get() ) )

Definition at line 446 of file details.h.

448  {
449  return details::deref( handle.get() );
450  }

◆ get() [2/2]

template<typename IFace , typename Algo >
auto Gaudi::Functional::details::get ( const ToolHandle< Gaudi::Interface::Bind::IBinder< IFace >> &  handle,
const Algo &  ,
const EventContext ctx 
)

Definition at line 453 of file details.h.

453  {
454  return handle.bind( ctx );
455  }

◆ get_values_helper()

template<typename Value , std::size_t... I>
auto Gaudi::Functional::details::get_values_helper ( std::index_sequence< I... >  )

Definition at line 157 of file details.h.

157  {
158  return std::make_tuple( ( (void)I, Value{} )... );
159  }

◆ getKey()

template<typename Handle >
auto Gaudi::Functional::details::getKey ( const Handle &  h) -> decltype( h.objKey() )

Definition at line 458 of file details.h.

458  {
459  return h.objKey();
460  }

◆ make_vector_of_handles()

template<typename Handles >
Handles Gaudi::Functional::details::make_vector_of_handles ( IDataHandleHolder owner,
const std::vector< DataObjID > &  init 
)

Definition at line 435 of file details.h.

435  {
436  Handles handles;
437  handles.reserve( init.size() );
438  std::transform( init.begin(), init.end(), std::back_inserter( handles ),
439  [&]( const auto& loc ) -> typename Handles::value_type {
440  return { loc, owner };
441  } );
442  return handles;
443  }

◆ put() [1/3]

template<typename Out1 , typename Out2 , typename = std::enable_if_t<std::is_constructible_v<Out1, Out2>>>
auto Gaudi::Functional::details::put ( const DataObjectHandle< AnyDataWrapper< Out1 >> &  out_handle,
Out2 &&  out 
)

Definition at line 173 of file details.h.

173  {
174  return out_handle.put( std::forward<Out2>( out ) );
175  }

◆ put() [2/3]

template<typename Out1 , typename Out2 , typename = std::enable_if_t<std::is_constructible_v<Out1, Out2> && std::is_base_of_v<DataObject, Out1>>>
auto Gaudi::Functional::details::put ( const DataObjectHandle< Out1 > &  out_handle,
Out2 &&  out 
)

Definition at line 168 of file details.h.

168  {
169  return out_handle.put( std::make_unique<Out1>( std::forward<Out2>( out ) ) );
170  }

◆ put() [3/3]

template<typename OutHandle , typename OptOut , typename = require_is_optional<OptOut>>
void Gaudi::Functional::details::put ( const OutHandle &  out_handle,
OptOut &&  out 
)

Definition at line 179 of file details.h.

179  {
180  if ( out ) put( out_handle, *std::forward<OptOut>( out ) );
181  }

◆ to_DataObjID()

std::vector<DataObjID> Gaudi::Functional::details::to_DataObjID ( const std::vector< std::string > &  in)
inline

Definition at line 114 of file details.h.

114  {
116  out.reserve( in.size() );
118  []( const std::string& i ) { return DataObjID{ i }; } );
119  return out;
120  }

◆ updateHandleLocation()

template<typename Out , typename In , typename Tr >
void Gaudi::Functional::details::updateHandleLocation ( DataHandleMixin< Out, In, Tr > &  parent,
const std::string prop,
const std::string newLoc 
)

Definition at line 509 of file details.h.

510  {
511  auto sc = parent.setProperty( prop, newLoc );
512  if ( sc.isFailure() ) throw GaudiException( "Could not set Property", prop + " -> " + newLoc, sc );
513  }

◆ updateHandleLocations()

template<typename Out , typename In , typename Tr >
void Gaudi::Functional::details::updateHandleLocations ( DataHandleMixin< Out, In, Tr > &  parent,
const std::string prop,
const std::vector< std::string > &  newLocs 
)

Definition at line 516 of file details.h.

517  {
519  GaudiUtils::details::ostream_joiner( ss << '[', newLocs, ", ", []( std::ostream& os, const auto& i ) -> auto& {
520  return os << "'" << i << "'";
521  } ) << ']';
522  auto sc = parent.setProperty( prop, ss.str() );
523  if ( sc.isFailure() ) throw GaudiException( "Could not set Property", prop + " -> " + ss.str(), sc );
524  }

Variable Documentation

◆ deref

constexpr struct Gaudi::Functional::details::deref_t Gaudi::Functional::details::deref

◆ insert

constexpr struct Gaudi::Functional::details::insert_t Gaudi::Functional::details::insert

◆ invoke_optionally

constexpr struct Gaudi::Functional::details::invoke_optionally_t Gaudi::Functional::details::invoke_optionally

◆ is_optional_v

template<typename Arg >
constexpr bool Gaudi::Functional::details::is_optional_v = Gaudi::cpp17::is_detected_v<details2::is_optional_, Arg>
constexpr

Definition at line 132 of file details.h.

◆ is_void_fun_v

template<typename Sig >
constexpr bool Gaudi::Functional::details::is_void_fun_v = is_void_fun<Sig>::value
inlineconstexpr

Definition at line 45 of file MergingTransformer.h.

◆ isLegacy

template<typename Traits >
constexpr bool Gaudi::Functional::details::isLegacy
inlineconstexpr
Initial value:
=
std::is_base_of_v<Gaudi::details::LegacyAlgorithmAdapter, details::BaseClass_t<Traits>>

Definition at line 428 of file details.h.

std::make_tuple
T make_tuple(T... args)
std::integral_constant
std::string
STL class.
std::is_void
std::vector< DataObjID >
std::vector::size
T size(T... args)
std::back_inserter
T back_inserter(T... args)
GaudiException
Definition: GaudiException.h:31
gaudirun.c
c
Definition: gaudirun.py:525
MultiMergers.Value
Value
Definition: MultiMergers.py:15
GaudiPython.Pythonizations.ctx
ctx
Definition: Pythonizations.py:578
std::ostream
STL class.
AlgSequencer.h
h
Definition: AlgSequencer.py:31
Gaudi::Functional::details::put
void put(const OutHandle &out_handle, OptOut &&out)
Definition: details.h:179
std::array
STL class.
Gaudi::Functional::details::for_impl
auto for_impl(F &&f, std::index_sequence< Is... >)
Definition: MergingTransformer.h:27
Gaudi::Functional::details::deref
constexpr struct Gaudi::Functional::details::deref_t deref
std::transform
T transform(T... args)
std::ostringstream
STL class.
DataObjectHandle::put
T * put(std::unique_ptr< T > object) const
Register object in transient store.
Definition: DataObjectHandle.h:180
std::vector::begin
T begin(T... args)
std::ostringstream::str
T str(T... args)
std::vector::end
T end(T... args)
GaudiUtils::details::ostream_joiner
Stream & ostream_joiner(Stream &os, Iterator first, Iterator last, Separator sep, OutputElement output=OutputElement{})
Definition: SerializeSTL.h:75
PrepareBase.out
out
Definition: PrepareBase.py:20