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... | |
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.
using proxy::CollectionProxy = typedef CollectionProxyBase<CollectionProxyElement, MainColl, AuxColls...> |
Base representation of a collection of proxied objects.
MainColl | type of the collection of the main data product |
AuxColls | type of all included auxiliary data proxies |
This object is a "specialization" of proxy::CollectionProxyBase
using proxy::CollectionProxyElement
as element type.
Definition at line 298 of file CollectionProxy.h.
using proxy::CollectionProxyFromArgs = typedef typename details::TemplateAdaptorOnePlus<CollectionProxy, Args...>::type |
Definition at line 305 of file CollectionProxy.h.
auto proxy::withCollectionProxy | ( | Args &&... | args | ) |
Helper function to merge an auxiliary proxy into the proxy.
AuxProxy | type (proxy tag) of auxiliary collection proxy requested |
Args | types of constructor arguments for parallel data proxy |
args | constructor arguments for the parallel data collection proxy |
getCollection()
knows to handle 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.
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.
auto proxy::withCollectionProxyAs | ( | Args &&... | args | ) |
The same as withCollectionProxy()
, but it also specified a tag.
Definition at line 36 of file withCollectionProxy.h.