LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
withAssociated.h
Go to the documentation of this file.
1 
15 #ifndef LARDATA_RECOBASEPROXY_PROXYBASE_WITHASSOCIATED_H
16 #define LARDATA_RECOBASEPROXY_PROXYBASE_WITHASSOCIATED_H
17 
18 // LArSoft libraries
21 
22 // C/C++ standard libraries
23 #include <tuple>
24 #include <utility> // std::forward(), std::move()
25 
26 namespace proxy {
27 
28  //----------------------------------------------------------------------------
29  namespace details {
30 
31  //--------------------------------------------------------------------------
52  template <typename Aux, typename Metadata, typename ArgTuple, typename AuxTag = Aux>
53  using WithAssociatedStruct = WithAssociatedStructBase<
54  Aux,
55  Metadata,
56  ArgTuple,
57  AssociatedDataProxyMakerWrapper<Aux, Metadata, AuxTag>::template maker_t,
58  AuxTag>;
59 
60  //--------------------------------------------------------------------------
61 
62  } // namespace details
63 
64  // --- BEGIN One-to-many sequential associations -----------------------------
89  //----------------------------------------------------------------------------
142  template <typename Aux, typename Metadata, typename AuxTag, typename... Args>
143  auto withAssociatedMetaAs(Args&&... args)
144  {
145  using ArgTuple_t = std::tuple<Args&&...>;
146  ArgTuple_t argsTuple(std::forward<Args>(args)...);
148  } // withAssociatedMetaAs()
149 
150  //----------------------------------------------------------------------------
198  template <typename Aux, typename AuxTag, typename... Args>
199  auto withAssociatedAs(Args&&... args)
200  {
201  return withAssociatedMetaAs<Aux, void, AuxTag>(std::forward<Args>(args)...);
202  }
203 
204  //----------------------------------------------------------------------------
325  template <typename Aux, typename Metadata, typename... Args>
326  auto withAssociatedMeta(Args&&... args)
327  {
328  return withAssociatedMetaAs<Aux, Metadata, Aux>(std::forward<Args>(args)...);
329  }
330 
366  template <typename Aux, typename... Args>
367  auto withAssociated(Args&&... args)
368  {
369  return withAssociatedMeta<Aux, void>(std::forward<Args>(args)...);
370  }
371 
372  //----------------------------------------------------------------------------
415  template <typename AuxTag, typename Assns>
416  auto wrapAssociatedAs(Assns const& assns)
417  {
418  using Aux_t = typename Assns::right_t;
419  using Metadata_t = lar::util::assns_metadata_t<Assns>;
421  } // wrapAssociatedAs()
422 
465  template <typename Assns>
466  auto wrapAssociated(Assns const& assns)
467  {
468  return wrapAssociatedAs<typename Assns::right_t>(assns);
469  }
470 
484  template <typename AuxTag, typename Assns>
485  auto wrapAssociated(Assns const& assns)
486  {
487  return wrapAssociatedAs<AuxTag>(assns);
488  }
489 
490  //----------------------------------------------------------------------------
491 
492 } // namespace proxy
493 
494 #endif // LARDATA_RECOBASEPROXY_PROXYBASE_WITHASSOCIATED_H
auto withAssociated(Args &&...args)
Helper function to merge associated data with no metadata.
Helper to create associated data proxy.
auto withAssociatedMeta(Args &&...args)
Helper function to merge associated data.
auto withAssociatedMetaAs(Args &&...args)
Helper function to merge associated data with metadata.
typename assns_metadata_type< Assns >::type assns_metadata_t
Trait: type of metadata in Assns (association or its node).
Definition: AssnsTraits.h:59
Infrastructure to add associated data to a collection proxy.
Helper to create associated data proxy.
Encloses LArSoft data product proxy objects and utilities.See this doxygen module for an introduction...
auto withAssociatedAs(Args &&...args)
Helper function to merge associated data with no metadata.
auto wrapAssociated(Assns const &assns)
Helper function to merge associated data from a given association.
auto wrapAssociatedAs(Assns const &assns)
Helper function to merge associated data from a given association.
Template class to declare addition of associated data to a proxy.