LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
ProxyAsParallelData.h
Go to the documentation of this file.
1 
11 #ifndef LARDATA_RECOBASEPROXY_PROXYBASE_PROXYASPARALLELDATA_H
12 #define LARDATA_RECOBASEPROXY_PROXYBASE_PROXYASPARALLELDATA_H
13 
14 // LArSoft libraries
15 #include "larcorealg/CoreUtils/ContainerMeta.h" // util::collection_value_t, ...
17 
18 // C/C++ standard
19 #include <utility> // std::move()
20 
21 namespace proxy {
22 
23  namespace details {
24 
25  template <typename AuxProxyColl,
27  typename Tag = Aux>
29 
30  } // namespace details
31 
32  // --- BEGIN Infrastructure for proxies as auxiliary data --------------------
44  template <typename Tag /* = Aux */,
45  typename Aux /* = util::collection_value_t<AuxProxyColl>*/,
46  typename AuxProxyColl>
47  auto makeProxyAsParallelData(AuxProxyColl&& auxProxy)
48  {
49  return details::ProxyAsParallelData<AuxProxyColl, Aux, Tag>(std::move(auxProxy));
50  } // makeProxyAsParallelData()
51 
54 
55  //----------------------------------------------------------------------------
56  namespace details {
57 
58  //--------------------------------------------------------------------------
69  template <typename AuxProxyColl,
70  typename Aux /* = util::collection_value_t<AuxProxyColl> */,
71  typename Tag /* = Aux */
72  >
73  struct ProxyAsParallelData : private AuxProxyColl, public ParallelData<AuxProxyColl, Aux, Tag> {
75  ProxyAsParallelData(AuxProxyColl&& proxy)
76  : AuxProxyColl(std::move(proxy))
77  , ParallelData<AuxProxyColl, Aux, Tag>(static_cast<AuxProxyColl const*>(this))
78  {}
79 
80  // explicitly select the tag from the parallel data (same as Tag)
82 
83  }; // class ProxyAsParallelData<>
84 
85  //--------------------------------------------------------------------------
86 
87  } // namespace details
88 
89 } // namespace proxy
90 
91 #endif // LARDATA_RECOBASEPROXY_PROXYBASE_PROXYASPARALLELDATA_H
Object to draft parallel data interface.
Definition: ParallelData.h:74
ProxyAsParallelData(AuxProxyColl &&proxy)
Steals and wraps collection proxy.
STL namespace.
Auxiliary data from parallel data products.
Encloses LArSoft data product proxy objects and utilities.See this doxygen module for an introduction...
auto makeProxyAsParallelData(AuxProxyColl &&auxProxy)
typename collection_value_type< Coll >::type collection_value_t
Type contained in the collection Coll.
Definition: ContainerMeta.h:62
C++ metaprogramming utilities for dealing with containers.
Object presenting a proxy as parallel data for another one.