1 #ifndef HeterogeneousCore_CUDACore_interface_ConvertingESProducerWithDependenciesT_h
2 #define HeterogeneousCore_CUDACore_interface_ConvertingESProducerWithDependenciesT_h
28 template <
template <
typename,
typename>
class Gen,
typename Tuple1,
typename Tuple2>
31 template <
template <
typename,
typename>
class Gen,
typename Tuple1,
typename Tuple2, std::size_t... Is>
33 return std::make_tuple(
37 template <
template <
typename,
typename>
class Gen,
typename... Ts1,
typename... Ts2>
39 static_assert(
sizeof...(Ts1) ==
sizeof...(Ts2));
40 using type =
typename std::decay<decltype(TypeZipperImpl<Gen>(
41 std::tuple<Ts1...>{}, std::tuple<Ts2...>{}, std::index_sequence_for<Ts1...>{}))>
::type;
46 template <
typename CombinedRecord,
typename Target,
typename... Dependencies>
49 template <
template <
typename...>
typename CombinedRecord,
50 typename... DepsRecords,
52 typename... Dependencies>
56 static constexpr std::size_t nsources =
sizeof...(Dependencies);
57 static_assert(
sizeof...(Dependencies) ==
sizeof...(DepsRecords));
60 std::vector<edm::ESInputTag>
tags(nsources);
61 for (std::size_t
i = 0;
i < nsources;
i++)
69 std::unique_ptr<Target>
produce(CombinedRecord<DepsRecords...>
const&
record) {
70 auto handles = std::tuple<edm::ESHandle<Dependencies>...>{};
80 for (std::size_t
i = 0;
i < nsources;
i++)
81 desc.add<
std::string>(
"label" + std::to_string(
i),
"")->setComment(
"Product Label");
91 template <std::
size_t N>
95 std::vector<edm::ESInputTag>
const&
tags) {
97 WalkConsumes<N - 1>::iterate(
cc, tokens,
tags);
98 std::get<N>(tokens) =
cc.consumes(
tags[
N]);
102 template <std::size_t
N,
typename...
Types>
104 static void iterate(CombinedRecord<DepsRecords...>
const& containingRecord,
105 std::tuple<Types...>& ts,
107 using Record =
typename std::tuple_element<
N, std::tuple<DepsRecords...>>
::type;
109 WalkAndCall<N - 1, Types...>::iterate(containingRecord, ts, tokens);
111 auto const&
record = containingRecord.template getRecord<Record>();
113 std::get<N>(ts) =
record.getHandle(std::get<N>(tokens));
118 #endif // HeterogeneousCore_CUDACore_interface_ConvertingESProducerWithDependenciesT_h