25 template <
typename... T>
28 template <
typename Handles>
31 handles.reserve( init.size() );
32 std::transform( init.begin(), init.end(), std::back_inserter( handles ),
33 [&](
const auto& loc ) ->
typename Handles::value_type {
34 return { loc, owner };
39 template <
typename OutputSpec,
typename InputSpec,
typename Traits_>
40 class DataHandleMixin;
42 template <
typename Out,
typename In,
typename Tr>
44 const std::string& newLoc ) {
45 parent.setProperty( prop, newLoc ).orThrow(
"Could not set Property", prop +
" -> " + newLoc );
48 template <
typename Out,
typename In,
typename Tr>
50 const std::vector<std::string>& newLocs ) {
51 std::ostringstream ss;
53 return os <<
"'" << i <<
"'";
55 parent.setProperty( prop, ss.str() ).orThrow(
"Could not set Property", prop +
" -> " + ss.str() );
58 template <
typename... In>
60 using type = std::tuple<In...>;
62 static_assert( !std::disjunction_v<std::is_same<EventContext, In>...>,
63 "EventContext can only appear as first argument" );
65 template <
typename Algorithm,
typename Handles>
67 return std::apply( [&](
const auto&... handle ) {
return algo(
get( handle, algo, ctx )... ); }, handles );
71 template <
typename... In>
75 using type = std::tuple<In...>;
77 static_assert( !std::disjunction_v<std::is_same<EventContext, In>...>,
78 "EventContext can only appear as first argument" );
80 template <
typename Algorithm,
typename Handles>
82 return std::apply( [&](
const auto&... handle ) {
return algo( ctx,
get( handle, algo, ctx )... ); }, handles );
86 template <
typename... In>
87 using filter_evtcontext =
88 typename filter_evtcontext_t<In...>::type;
90 template <
typename... Out,
typename... In,
typename Traits_>
91 class [[deprecated(
"use DataHandleMixin<type_list<...>, type_list<...>, Traits> instead" )]]
DataHandleMixin<
92 std::tuple<Out...>, std::tuple<In...>, Traits_>
93 :
public DataHandleMixin<type_list<Out...>, type_list<In...>, Traits_> {
97 using base_class::base_class;
Provide serialization function (output only) for some common STL classes (vectors,...
This class represents an entry point to all the event specific data.
Base class from which all concrete algorithm classes should be derived.
DataHandleMixin(std::string name, ISvcLocator *pSvcLocator, const IArgs &inputs, std::index_sequence< I... >, const OArgs &outputs, std::index_sequence< J... >)
DataHandleMixin< type_list< Out... >, type_list< In... >, Traits_ > base_class
auto get(const Handle &handle, const Algo &, const EventContext &) -> decltype(details::deref(handle.get()))
Handles make_vector_of_handles(IDataHandleHolder *owner, const std::vector< DataObjID > &init)
void updateHandleLocation(DataHandleMixin< Out, In, Tr > &parent, const std::string &prop, const std::string &newLoc)
void updateHandleLocations(DataHandleMixin< Out, In, Tr > &parent, const std::string &prop, const std::vector< std::string > &newLocs)
Stream & ostream_joiner(Stream &os, Iterator first, Iterator last, Separator sep, OutputElement output=OutputElement{})
static auto apply(const Algorithm &algo, const EventContext &ctx, Handles &handles)
static auto apply(const Algorithm &algo, const EventContext &ctx, Handles &handles)