LArSoft  v07_13_02
Liquid Argon Software toolkit - http://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 
27 namespace proxy {
28 
29  //----------------------------------------------------------------------------
30  namespace details {
31 
32  //--------------------------------------------------------------------------
53  template <
54  typename Aux, typename Metadata,
55  typename ArgTuple, typename AuxTag = Aux
56  >
57  using WithAssociatedStruct = WithAssociatedStructBase<
58  Aux,
59  Metadata,
60  ArgTuple,
61  AssociatedDataProxyMakerWrapper<Aux, Metadata, AuxTag>::template maker_t,
62  AuxTag
63  >;
64 
65  //--------------------------------------------------------------------------
66 
67  } // namespace details
68 
69 
70  // --- BEGIN One-to-many sequential associations -----------------------------
95  //----------------------------------------------------------------------------
148  template <typename Aux, typename Metadata, typename AuxTag, typename... Args>
149  auto withAssociatedMetaAs(Args&&... args) {
150  using ArgTuple_t = std::tuple<Args&&...>;
151  ArgTuple_t argsTuple(std::forward<Args>(args)...);
153  (std::move(argsTuple));
154  } // withAssociatedMetaAs()
155 
156 
157  //----------------------------------------------------------------------------
205  template <typename Aux, typename AuxTag, typename... Args>
206  auto withAssociatedAs(Args&&... args)
207  {
208  return withAssociatedMetaAs<Aux, void, AuxTag>
209  (std::forward<Args>(args)...);
210  }
211 
212 
213  //----------------------------------------------------------------------------
334  template <typename Aux, typename Metadata, typename... Args>
335  auto withAssociatedMeta(Args&&... args)
336  {
337  return withAssociatedMetaAs<Aux, Metadata, Aux>
338  (std::forward<Args>(args)...);
339  }
340 
341 
377  template <typename Aux, typename... Args>
378  auto withAssociated(Args&&... args)
379  { return withAssociatedMeta<Aux, void>(std::forward<Args>(args)...); }
380 
381 
382  //----------------------------------------------------------------------------
425  template <typename AuxTag, typename Assns>
426  auto wrapAssociatedAs(Assns const& assns)
427  {
428  using Aux_t = typename Assns::right_t;
429  using Metadata_t = lar::util::assns_metadata_t<Assns>;
430  return
432  ({});
433  } // wrapAssociatedAs()
434 
435 
478  template <typename Assns>
479  auto wrapAssociated(Assns const& assns)
480  { return wrapAssociatedAs<typename Assns::right_t>(assns); }
481 
482 
496  template <typename AuxTag, typename Assns>
497  auto wrapAssociated(Assns const& assns)
498  { return wrapAssociatedAs<AuxTag>(assns); }
499 
500  //----------------------------------------------------------------------------
501 
502 } // namespace proxy
503 
504 
505 #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:62
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.