LArSoft  v07_13_02
Liquid Argon Software toolkit - http://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 
15 // LArSoft libraries
17 #include "larcorealg/CoreUtils/ContainerMeta.h" // util::collection_value_t, ...
18 
19 // C/C++ standard
20 #include <utility> // std::move()
21 
22 
23 namespace proxy {
24 
25  namespace details {
26 
27  template <
28  typename AuxProxyColl,
30  typename Tag = Aux
31  >
33 
34  } // namespace details
35 
36 
37  // --- BEGIN Infrastructure for proxies as auxiliary data --------------------
49  template <
50  typename Tag /* = Aux */,
51  typename Aux /* = util::collection_value_t<AuxProxyColl>*/,
52  typename AuxProxyColl
53  >
54  auto makeProxyAsParallelData(AuxProxyColl&& auxProxy)
55  {
57  (std::move(auxProxy));
58  } // makeProxyAsParallelData()
59 
60 
63 
64 
65  //----------------------------------------------------------------------------
66  namespace details {
67 
68  //--------------------------------------------------------------------------
79  template <
80  typename AuxProxyColl,
81  typename Aux /* = util::collection_value_t<AuxProxyColl> */,
82  typename Tag /* = Aux */
83  >
84  struct ProxyAsParallelData
85  : private AuxProxyColl
86  , public ParallelData<AuxProxyColl, Aux, Tag>
87  {
89  ProxyAsParallelData(AuxProxyColl&& proxy)
90  : AuxProxyColl(std::move(proxy))
91  , ParallelData<AuxProxyColl, Aux, Tag>
92  (static_cast<AuxProxyColl const*>(this))
93  {}
94 
95  // explicitly select the tag from the parallel data (same as Tag)
97 
98  }; // class ProxyAsParallelData<>
99 
100 
101  //--------------------------------------------------------------------------
102 
103  } // namespace details
104 
105 } // namespace proxy
106 
107 
108 #endif // LARDATA_RECOBASEPROXY_PROXYBASE_PROXYASPARALLELDATA_H
Object to draft parallel data interface.
Definition: ParallelData.h:82
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:65
C++ metaprogramming utilities for dealing with containers.
Object presenting a proxy as parallel data for another one.