11 #ifndef LARDATA_RECOBASEPROXY_PROXYBASE_COLLECTIONPROXYELEMENT_H 12 #define LARDATA_RECOBASEPROXY_PROXYBASE_COLLECTIONPROXYELEMENT_H 23 #include <type_traits> 33 template <
typename AuxCollTuple>
161 template <
typename CollProxy>
170 <
typename collection_proxy_t::aux_collections_t>::type;
176 : fIndex(index), fMain(&main) , fAuxData(std::move(auxData))
186 std::size_t
index()
const {
return fIndex; };
189 template <
typename Tag>
190 auto get()
const -> decltype(
auto)
191 {
return std::get<util::index_of_tag_v<Tag, aux_elements_t>>(fAuxData); }
261 template <
typename Tag,
typename T = Tag const&>
262 auto getIf()
const -> decltype(
auto);
266 template <
typename Tag>
267 static constexpr
bool has() {
return util::has_tag_v<Tag, aux_elements_t>; }
278 template <
typename Tag,
typename>
281 template <typename Tag, typename T>
306 template <
typename ProxyElement,
typename... AuxData>
309 typename ProxyElement::main_element_t
const& main,
314 typename ProxyElement::aux_elements_t(std::forward<AuxData>(auxData)...)
338 template <
typename Tuple>
344 template <
typename... T>
346 using type = std::tuple<
typename T::auxiliary_data_t...>;
357 template <
typename CollProxy>
358 template <
typename Tag,
typename T>
364 template <
typename CollProxy>
365 template <
typename Tag,
typename>
368 {
return get<Tag>(); }
370 template <
typename CollProxy>
371 template <
typename Tag,
typename T>
375 throw std::logic_error
376 (
"Tag '" + lar::debug::demangle<Tag>() +
"' not available.");
385 #endif // LARDATA_RECOBASEPROXY_PROXYBASE_COLLECTIONPROXYELEMENT_H main_element_t const * operator->() const
Returns a pointer to the main element.
auto makeCollectionProxyElement(std::size_t index, typename ProxyElement::main_element_t const &main, AuxData &&...auxData)
Creates a collection proxy element object from data structures.
Namespace for general, non-LArSoft-specific utilities.
int main(int argc, char **argv)
typename collection_proxy_t::main_element_t main_element_t
aux_elements_t fAuxData
Data associated to the main object.
static constexpr bool has()
Returns whether this class knowns about the specified type (Tag).
main_element_t const * fMain
Pointer to the main object of the element.
CollProxy collection_proxy_t
Encloses LArSoft data product proxy objects and utilities.See this doxygen module for an introduction...
std::size_t index() const
Returns the index of this element in the collection.
std::size_t fIndex
Index of this element in the proxy.
A std::true_type with a template argument.
An element of a collection proxy.
Functions to help debugging by instrumenting code.
typename details::SubstituteWithAuxList< typename collection_proxy_t::aux_collections_t >::type aux_elements_t
Tuple of elements (expected to be tagged types).
Utilities to address elements of a tuple-like class by tag.
std::tuple< typename T::auxiliary_data_t... > type
auto getIf() const -> decltype(auto)
Returns the auxiliary data specified by type (Tag).
main_element_t const & operator*() const
Returns a reference to the main element.
auto getIfHas(util::bool_constant< true >) const -> decltype(auto)