LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
proxy::details::ParallelData< AuxColl, Aux, Tag > Class Template Reference

Object to draft parallel data interface. More...

#include "ParallelData.h"

Public Types

using tag = Tag
 Tag of this association proxy. More...
 
using auxiliary_data_t = decltype(util::makeTagged< tag >(std::declval< aux_element_t >()))
 Type returned when accessing auxiliary data. More...
 

Public Member Functions

 ParallelData (parallel_data_t const &data)
 Constructor: points to the specified data collection. More...
 
auto begin () const -> decltype(auto)
 Returns an iterator pointing to the first data element. More...
 
auto end () const -> decltype(auto)
 Returns an iterator pointing past the last data element. More...
 
auto operator[] (std::size_t index) const -> decltype(auto)
 Returns the element with the specified index (no check performed). More...
 
parallel_data_t const * data () const
 Returns a pointer to the whole data collection. More...
 
parallel_data_t const & dataRef () const
 Returns a reference to the whole data collection. More...
 

Static Public Member Functions

template<typename TestTag >
static constexpr bool hasTag ()
 Returns whether this data is labeled with the specified tag. More...
 

Private Types

using This_t = ParallelData< AuxColl, Aux, Tag >
 This type. More...
 
using parallel_data_t = AuxColl
 Type of auxiliary collection. More...
 
using aux_t = Aux
 Type of the value of auxiliary collection element. More...
 
using aux_element_t = util::collection_value_constant_access_t< AuxColl >
 Type returned when accessing an auxiliary collection element. More...
 
using parallel_data_iterator_t = typename parallel_data_t::const_iterator
 

Private Member Functions

auto getElement (std::size_t index) const -> decltype(auto)
 

Private Attributes

parallel_data_t const * fData
 Reference to the original data product. More...
 

Detailed Description

template<typename AuxColl, typename Aux, typename Tag>
class proxy::details::ParallelData< AuxColl, Aux, Tag >

Object to draft parallel data interface.

Template Parameters
AuxColltype of the parallel data collection
Auxtype of the associated object
Tagtag this data is labeled with

Allows:

  • random access (no index check guarantee)
  • forward iteration

Construction is not part of the interface.

Definition at line 74 of file ParallelData.h.

Member Typedef Documentation

template<typename AuxColl, typename Aux, typename Tag>
using proxy::details::ParallelData< AuxColl, Aux, Tag >::aux_element_t = util::collection_value_constant_access_t<AuxColl>
private

Type returned when accessing an auxiliary collection element.

Definition at line 84 of file ParallelData.h.

template<typename AuxColl, typename Aux, typename Tag>
using proxy::details::ParallelData< AuxColl, Aux, Tag >::aux_t = Aux
private

Type of the value of auxiliary collection element.

Definition at line 81 of file ParallelData.h.

template<typename AuxColl, typename Aux, typename Tag>
using proxy::details::ParallelData< AuxColl, Aux, Tag >::auxiliary_data_t = decltype(util::makeTagged<tag>(std::declval<aux_element_t>()))

Type returned when accessing auxiliary data.

Definition at line 92 of file ParallelData.h.

template<typename AuxColl, typename Aux, typename Tag>
using proxy::details::ParallelData< AuxColl, Aux, Tag >::parallel_data_iterator_t = typename parallel_data_t::const_iterator
private

Definition at line 86 of file ParallelData.h.

template<typename AuxColl, typename Aux, typename Tag>
using proxy::details::ParallelData< AuxColl, Aux, Tag >::parallel_data_t = AuxColl
private

Type of auxiliary collection.

Definition at line 78 of file ParallelData.h.

template<typename AuxColl, typename Aux, typename Tag>
using proxy::details::ParallelData< AuxColl, Aux, Tag >::tag = Tag

Tag of this association proxy.

Definition at line 89 of file ParallelData.h.

template<typename AuxColl, typename Aux, typename Tag>
using proxy::details::ParallelData< AuxColl, Aux, Tag >::This_t = ParallelData<AuxColl, Aux, Tag>
private

This type.

Definition at line 75 of file ParallelData.h.

Constructor & Destructor Documentation

template<typename AuxColl, typename Aux, typename Tag>
proxy::details::ParallelData< AuxColl, Aux, Tag >::ParallelData ( parallel_data_t const &  data)
inline

Constructor: points to the specified data collection.

Definition at line 95 of file ParallelData.h.

95 : fData(&data) {}
parallel_data_t const * data() const
Returns a pointer to the whole data collection.
Definition: ParallelData.h:119
parallel_data_t const * fData
Reference to the original data product.
Definition: ParallelData.h:125

Member Function Documentation

template<typename AuxColl, typename Aux, typename Tag>
auto proxy::details::ParallelData< AuxColl, Aux, Tag >::begin ( ) const -> decltype(auto)
inline

Returns an iterator pointing to the first data element.

Definition at line 98 of file ParallelData.h.

98 { return fData->begin(); }
parallel_data_t const * fData
Reference to the original data product.
Definition: ParallelData.h:125
template<typename AuxColl, typename Aux, typename Tag>
parallel_data_t const* proxy::details::ParallelData< AuxColl, Aux, Tag >::data ( ) const
inline

Returns a pointer to the whole data collection.

Definition at line 119 of file ParallelData.h.

Referenced by proxy::details::ParallelData< AuxProxyColl, Aux, Tag >::dataRef(), and proxy::makeParallelData().

119 { return fData; }
parallel_data_t const * fData
Reference to the original data product.
Definition: ParallelData.h:125
template<typename AuxColl, typename Aux, typename Tag>
parallel_data_t const& proxy::details::ParallelData< AuxColl, Aux, Tag >::dataRef ( ) const
inline

Returns a reference to the whole data collection.

Definition at line 122 of file ParallelData.h.

122 { return *(data()); }
parallel_data_t const * data() const
Returns a pointer to the whole data collection.
Definition: ParallelData.h:119
template<typename AuxColl, typename Aux, typename Tag>
auto proxy::details::ParallelData< AuxColl, Aux, Tag >::end ( ) const -> decltype(auto)
inline

Returns an iterator pointing past the last data element.

Definition at line 101 of file ParallelData.h.

101 { return fData->end(); }
parallel_data_t const * fData
Reference to the original data product.
Definition: ParallelData.h:125
template<typename AuxColl, typename Aux, typename Tag>
auto proxy::details::ParallelData< AuxColl, Aux, Tag >::getElement ( std::size_t  index) const -> decltype(auto)
inlineprivate

Definition at line 127 of file ParallelData.h.

Referenced by proxy::details::ParallelData< AuxProxyColl, Aux, Tag >::operator[]().

128  {
129  return util::makeTagged<tag>(fData->operator[](index));
130  }
parallel_data_t const * fData
Reference to the original data product.
Definition: ParallelData.h:125
template<typename AuxColl, typename Aux, typename Tag>
template<typename TestTag >
static constexpr bool proxy::details::ParallelData< AuxColl, Aux, Tag >::hasTag ( )
inlinestatic

Returns whether this data is labeled with the specified tag.

Definition at line 113 of file ParallelData.h.

114  {
115  return std::is_same<TestTag, tag>();
116  }
template<typename AuxColl, typename Aux, typename Tag>
auto proxy::details::ParallelData< AuxColl, Aux, Tag >::operator[] ( std::size_t  index) const -> decltype(auto)
inline

Returns the element with the specified index (no check performed).

Definition at line 104 of file ParallelData.h.

105  {
106  static_assert(std::is_convertible<decltype(getElement(index)), auxiliary_data_t>(),
107  "Inconsistent data types.");
108  return getElement(index);
109  }
decltype(util::makeTagged< tag >(std::declval< aux_element_t >())) auxiliary_data_t
Type returned when accessing auxiliary data.
Definition: ParallelData.h:92
auto getElement(std::size_t index) const -> decltype(auto)
Definition: ParallelData.h:127

Member Data Documentation

template<typename AuxColl, typename Aux, typename Tag>
parallel_data_t const* proxy::details::ParallelData< AuxColl, Aux, Tag >::fData
private

The documentation for this class was generated from the following file: