LArSoft  v07_13_02
Liquid Argon Software toolkit - http://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 <utility> // std::forward(), std::move()
23 #include <type_traits> // std::is_convertible<>, std::decay_t<>, ...
24 
25 
26 namespace proxy {
27 
28  // --- BEGIN Collection proxy infrastructure ---------------------------------
31 
32  //----------------------------------------------------------------------------
35  template <typename AuxProxy, typename AuxTag, typename... Args>
36  auto withCollectionProxyAs(Args&&... args)
37  {
38  using ArgTuple_t = std::tuple<Args&&...>;
39  static_assert(
40  std::is_convertible
41  <std::decay_t<std::tuple_element_t<0U, ArgTuple_t>>, art::InputTag>(),
42  "The first argument of withCollectionProxyAs() must be art::InputTag."
43  );
44  ArgTuple_t argsTuple(std::forward<Args>(args)...);
46  (std::move(argsTuple));
47  } // withCollectionProxyAs()
48 
49  //----------------------------------------------------------------------------
76  template <typename AuxProxy, typename... Args>
77  auto withCollectionProxy(Args&&... args)
78  {
79  return
80  withCollectionProxyAs<AuxProxy, AuxProxy>(std::forward<Args>(args)...);
81  }
82 
83 
85  // --- END Collection proxy infrastructure -----------------------------------
86 
87 } // namespace proxy
88 
89 
90 #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.