LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/

Infrastructure to define a proxy of collection data product. More...

Classes

class  proxy::CollectionProxyBase< Element, MainColl, AuxColls >
 Base representation of a collection of proxied objects. More...
 
struct  proxy::CollectionProxyMakerTraits< Proxy, Selector >
 Collection of data type definitions for collection proxies. More...
 
struct  proxy::CollectionProxyMakerBase< CollProxy >
 Class to assemble the required proxy. More...
 
struct  proxy::CollectionProxyMaker< CollProxy >
 Class to assemble the required proxy. More...
 

Typedefs

template<typename MainColl , typename... AuxColls>
using proxy::CollectionProxy = CollectionProxyBase< CollectionProxyElement, MainColl, AuxColls... >
 Base representation of a collection of proxied objects. More...
 
template<typename... Args>
using proxy::CollectionProxyFromArgs = typename details::TemplateAdaptorOnePlus< CollectionProxy, Args... >::type
 

Functions

template<typename AuxProxy , typename AuxTag , typename... Args>
auto proxy::withCollectionProxyAs (Args &&...args)
 
template<typename AuxProxy , typename... Args>
auto proxy::withCollectionProxy (Args &&...args)
 Helper function to merge an auxiliary proxy into the proxy. More...
 

Detailed Description

Infrastructure to define a proxy of collection data product.

A data collection proxy connects a main collection data product with other data products whose elements have relation with one of the main product elements.

A collection proxy is created via a call to getCollection(), in a fashion non dissimilar from calling, e.g., art::Event::getValidHandle().

A proxy is characterized by a proxy tag, which is the type used in the getCollection() call, but that is not necessarily in direct relation with the type of the collection proxy itself. In other words, calling proxy::getCollection<proxy::Tracks>(event, trackTag) will return a proxy object whose type is likely not proxy::Tracks.

Proxy collections are created by merging auxiliary data into a main collection data product. See getCollection() for more details.

Proxies can be customized, meaning that collection proxies may be written to have a specific interface. There are different levels of customization, of the collection proxy itself, of its element type, and of the auxiliary data merged. Customization may require quite a bit of coding, and the easiest approach is to start from an already customized proxy implementing features similar to the desired ones.

It's worth stressing again that collection proxies composed by merging different auxiliary data have different C++ types, and that if such proxies need to be propagated as function arguments those arguments need to be of template type.

Typedef Documentation

template<typename MainColl , typename... AuxColls>
using proxy::CollectionProxy = typedef CollectionProxyBase<CollectionProxyElement, MainColl, AuxColls...>

Base representation of a collection of proxied objects.

Template Parameters
MainColltype of the collection of the main data product
AuxCollstype of all included auxiliary data proxies
See also
proxy::CollectionProxyElement

This object is a "specialization" of proxy::CollectionProxyBase using proxy::CollectionProxyElement as element type.

Definition at line 298 of file CollectionProxy.h.

template<typename... Args>
using proxy::CollectionProxyFromArgs = typedef typename details::TemplateAdaptorOnePlus<CollectionProxy, Args...>::type

Definition at line 305 of file CollectionProxy.h.

Function Documentation

template<typename AuxProxy , typename... Args>
auto proxy::withCollectionProxy ( Args &&...  args)

Helper function to merge an auxiliary proxy into the proxy.

Template Parameters
AuxProxytype (proxy tag) of auxiliary collection proxy requested
Argstypes of constructor arguments for parallel data proxy
Parameters
argsconstructor arguments for the parallel data collection proxy
Returns
a temporary object that getCollection() knows to handle
Bug:
Broken in many ways. Do not use.

This function is meant to convey to getCollection() function the request for merging a collection proxy to carry auxiliary data structured as another collection proxy, parallel to the main collection. The function also bridges the information required to create a proxy to that auxiliary data.

This data will be tagged with the type AuxProxy. To use a different type as tag, use withCollectionProxyAs() instead, specifying the tag as second template argument.

Customization of the auxiliary collection proxy

The customization of auxiliary collection proxy happens in a fashion similar to the customization presented in withParallelData(). The customization point here is ProxyAsAuxProxyMaker.

Definition at line 77 of file withCollectionProxy.h.

78  {
79  return
80  withCollectionProxyAs<AuxProxy, AuxProxy>(std::forward<Args>(args)...);
81  }
template<typename AuxProxy , typename AuxTag , typename... Args>
auto proxy::withCollectionProxyAs ( Args &&...  args)

The same as withCollectionProxy(), but it also specified a tag.

Bug:
Broken in many ways. Do not use.

Definition at line 36 of file withCollectionProxy.h.

37  {
38  using ArgTuple_t = std::tuple<Args&&...>;
39  static_assert(
40  std::is_convertible
41  <std::decay_t<std::tuple_element_t<0U, ArgTuple_t>>, art::InputTag>(),
42  "The first argument of withCollectionProxyAs() must be art::InputTag."
43  );
44  ArgTuple_t argsTuple(std::forward<Args>(args)...);
45  return details::WithProxyAsAuxStructBase<AuxProxy, ArgTuple_t, AuxTag>
46  (std::move(argsTuple));
47  } // withCollectionProxyAs()