LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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 namespace proxy {
23 
24  namespace details {
25 
26  template <typename Aux, typename Metadata, typename ArgTuple, typename AuxTag = Aux>
27  using WithOneTo01AssociatedStruct = WithAssociatedStructBase<
28  Aux,
29  Metadata,
30  ArgTuple,
31  OneTo01DataProxyMakerWrapper<Aux, Metadata, AuxTag>::template maker_t,
32  AuxTag>;
33 
34  } // namespace details
35 
36  // --- BEGIN One-to-one (optional) associations ------------------------------
59  //----------------------------------------------------------------------------
63  template <typename Aux, typename Metadata, typename AuxTag, typename... Args>
64  auto withZeroOrOneMetaAs(Args&&... args)
65  {
66  using ArgTuple_t = std::tuple<Args&&...>;
67  ArgTuple_t argsTuple(std::forward<Args>(args)...);
69  std::move(argsTuple));
70  } // withZeroOrOneAs()
71 
74  template <typename Aux, typename AuxTag, typename... Args>
75  auto withZeroOrOneAs(Args&&... args)
76  {
77  return withZeroOrOneMetaAs<Aux, void, AuxTag>(std::forward<Args>(args)...);
78  }
79 
143  template <typename Aux, typename Metadata, typename... Args>
144  auto withZeroOrOneMeta(Args&&... args)
145  {
146  return withZeroOrOneMetaAs<Aux, Metadata, Aux>(std::forward<Args>(args)...);
147  }
148 
152  template <typename Aux, typename... Args>
153  auto withZeroOrOne(Args&&... args)
154  {
155  return withZeroOrOneMeta<Aux, void>(std::forward<Args>(args)...);
156  }
157 
159  // --- END One-to-one (optional) associations --------------------------------
160 
161 } // namespace proxy
162 
163 #endif // LARDATA_RECOBASEPROXY_PROXYBASE_WITHZEROORONE_H
Helper to create associated data proxy.
auto withZeroOrOneAs(Args &&...args)
Definition: withZeroOrOne.h:75
WithAssociatedStructBase< Aux, Metadata, ArgTuple, OneTo01DataProxyMakerWrapper< Aux, Metadata, AuxTag >::template maker_t, AuxTag > WithOneTo01AssociatedStruct
Definition: withZeroOrOne.h:32
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.
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:64