LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
withZeroOrOne.h
Go to the documentation of this file.
1 
11 #ifndef LARDATA_RECOBASEPROXY_PROXYBASE_WITHZEROORONE_H
12 #define LARDATA_RECOBASEPROXY_PROXYBASE_WITHZEROORONE_H
13 
14 // LArSoft libraries
17 
18 // C/C++ standard libraries
19 #include <tuple>
20 #include <utility> // std::forward(), std::move()
21 
22 
23 namespace proxy {
24 
25  namespace details {
26 
27  template <
28  typename Aux, typename Metadata, typename ArgTuple,
29  typename AuxTag = Aux
30  >
31  using WithOneTo01AssociatedStruct = WithAssociatedStructBase<
32  Aux,
33  Metadata,
34  ArgTuple,
35  OneTo01DataProxyMakerWrapper<Aux, Metadata, AuxTag>::template maker_t,
36  AuxTag
37  >;
38 
39  } // namespace details
40 
41  // --- BEGIN One-to-one (optional) associations ------------------------------
64  //----------------------------------------------------------------------------
68  template <typename Aux, typename Metadata, typename AuxTag, typename... Args>
69  auto withZeroOrOneMetaAs(Args&&... args) {
70  using ArgTuple_t = std::tuple<Args&&...>;
71  ArgTuple_t argsTuple(std::forward<Args>(args)...);
72  return
74  (std::move(argsTuple));
75  } // withZeroOrOneAs()
76 
77 
80  template <typename Aux, typename AuxTag, typename... Args>
81  auto withZeroOrOneAs(Args&&... args)
82  {
83  return
84  withZeroOrOneMetaAs<Aux, void, AuxTag>(std::forward<Args>(args)...);
85  }
86 
150  template <typename Aux, typename Metadata, typename... Args>
151  auto withZeroOrOneMeta(Args&&... args)
152  {
153  return
154  withZeroOrOneMetaAs<Aux, Metadata, Aux>(std::forward<Args>(args)...);
155  }
156 
160  template <typename Aux, typename... Args>
161  auto withZeroOrOne(Args&&... args)
162  { return withZeroOrOneMeta<Aux, void>(std::forward<Args>(args)...); }
163 
165  // --- END One-to-one (optional) associations --------------------------------
166 
167 } // namespace proxy
168 
169 
170 #endif // LARDATA_RECOBASEPROXY_PROXYBASE_WITHZEROORONE_H
Helper to create associated data proxy.
auto withZeroOrOneAs(Args &&...args)
Definition: withZeroOrOne.h:81
auto withZeroOrOne(Args &&...args)
Encloses LArSoft data product proxy objects and utilities.See this doxygen module for an introduction...
Infrastructure for merging optional associated data to a proxy.
WithAssociatedStructBase< Aux, Metadata, ArgTuple, OneTo01DataProxyMakerWrapper< Aux, Metadata, AuxTag >::template maker_t, AuxTag > WithOneTo01AssociatedStruct
Definition: withZeroOrOne.h:37
auto withZeroOrOneMeta(Args &&...args)
Helper function to merge one-to-(zero-or-one) associated data.
Template class to declare addition of associated data to a proxy.
auto withZeroOrOneMetaAs(Args &&...args)
Definition: withZeroOrOne.h:69