LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
withCollectionProxy.h
Go to the documentation of this file.
1 
11 #ifndef LARDATA_RECOBASEPROXY_PROXYBASE_WITHCOLLECTIONPROXY_H
12 #define LARDATA_RECOBASEPROXY_PROXYBASE_WITHCOLLECTIONPROXY_H
13 
14 // LArSoft libraries
16 
17 // framework libraries
19 
20 // C/C++ standard
21 #include <tuple> // also std::tuple_element_t<>
22 #include <type_traits> // std::is_convertible<>, std::decay_t<>, ...
23 #include <utility> // std::forward(), std::move()
24 
25 namespace proxy {
26 
27  // --- BEGIN Collection proxy infrastructure ---------------------------------
30 
31  //----------------------------------------------------------------------------
34  template <typename AuxProxy, typename AuxTag, typename... Args>
35  auto withCollectionProxyAs(Args&&... args)
36  {
37  using ArgTuple_t = std::tuple<Args&&...>;
38  static_assert(
39  std::is_convertible<std::decay_t<std::tuple_element_t<0U, ArgTuple_t>>, art::InputTag>(),
40  "The first argument of withCollectionProxyAs() must be art::InputTag.");
41  ArgTuple_t argsTuple(std::forward<Args>(args)...);
43  } // withCollectionProxyAs()
44 
45  //----------------------------------------------------------------------------
72  template <typename AuxProxy, typename... Args>
73  auto withCollectionProxy(Args&&... args)
74  {
75  return withCollectionProxyAs<AuxProxy, AuxProxy>(std::forward<Args>(args)...);
76  }
77 
79  // --- END Collection proxy infrastructure -----------------------------------
80 
81 } // namespace proxy
82 
83 #endif // LARDATA_RECOBASEPROXY_PROXYBASE_WITHCOLLECTIONPROXY_H
Infrastructure for a collection proxy as auxiliary data for a proxy.
auto withCollectionProxyAs(Args &&...args)
Encloses LArSoft data product proxy objects and utilities.See this doxygen module for an introduction...
auto withCollectionProxy(Args &&...args)
Helper function to merge an auxiliary proxy into the proxy.
Helper to create a proxy as auxiliary data for another proxy.