Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Attributes | List of all members
proxy::details::AssociatedData< Main, Aux, Metadata, Tag > Class Template Reference

Object to draft associated data interface. More...

#include <AssociatedData.h>

Public Types

using assns_t = art::Assns< Main, Aux, Metadata >
 Type of art association. More...
 
using tag = Tag
 Tag of this association proxy. More...
 
using group_ranges_t = BoundaryList< associated_data_iterator_t >
 
using auxiliary_data_t = util::add_tag_t< typename group_ranges_t::range_t, tag >
 Type of collection of auxiliary data associated with a main item. More...
 

Public Member Functions

 AssociatedData (group_ranges_t &&groups)
 
auto begin () const -> decltype(auto)
 Returns an iterator pointing to the first associated data range. More...
 
auto end () const -> decltype(auto)
 Returns an iterator pointing past the last associated data range. More...
 
auto getRange (std::size_t i) const -> decltype(auto)
 Returns the range with the specified index (no check performed). More...
 
auto operator[] (std::size_t index) const -> decltype(auto)
 Returns the range with the specified index (no check performed). 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 = AssociatedData< Main, Aux, Metadata, Tag >
 This type. More...
 
using associated_data_iterator_t = assns_node_iterator< lar::util::assns_iterator_t< assns_t >>
 

Private Attributes

group_ranges_t fGroups
 

Detailed Description

template<typename Main, typename Aux, typename Metadata, typename Tag>
class proxy::details::AssociatedData< Main, Aux, Metadata, Tag >

Object to draft associated data interface.

Template Parameters
Maintype of the main associated object (one)
Auxtype of the additional associated objects (many)
Metadatatype of metadata in the association (default: void)
Tagtag this data is labeled with

Allows:

Construction is not part of the interface.

The AssociatedData object, on creation, finds the borders surrounding the associated Aux objects for each Main one, and keep a record of them (this is actually delegated to BoundaryList class). The AssociatedData object also provides a container-like view of this information, where each element in the container is associated to a single Main and it is a container (actually, another view) of Right. Both levels of containers are random access, so that the set of Right objects associated to a Left can be accessed by index, and the Right objects within can be accessed with Right index in the Left.

Definition at line 781 of file AssociatedData.h.

Member Typedef Documentation

template<typename Main , typename Aux , typename Metadata , typename Tag >
using proxy::details::AssociatedData< Main, Aux, Metadata, Tag >::assns_t = art::Assns<Main, Aux, Metadata>

Type of art association.

Definition at line 786 of file AssociatedData.h.

template<typename Main , typename Aux , typename Metadata , typename Tag >
using proxy::details::AssociatedData< Main, Aux, Metadata, Tag >::associated_data_iterator_t = assns_node_iterator<lar::util::assns_iterator_t<assns_t>>
private

Definition at line 790 of file AssociatedData.h.

template<typename Main , typename Aux , typename Metadata , typename Tag >
using proxy::details::AssociatedData< Main, Aux, Metadata, Tag >::auxiliary_data_t = util::add_tag_t<typename group_ranges_t::range_t, tag>

Type of collection of auxiliary data associated with a main item.

Definition at line 800 of file AssociatedData.h.

template<typename Main , typename Aux , typename Metadata , typename Tag >
using proxy::details::AssociatedData< Main, Aux, Metadata, Tag >::group_ranges_t = BoundaryList<associated_data_iterator_t>

Definition at line 796 of file AssociatedData.h.

template<typename Main , typename Aux , typename Metadata , typename Tag >
using proxy::details::AssociatedData< Main, Aux, Metadata, Tag >::tag = Tag

Tag of this association proxy.

Definition at line 794 of file AssociatedData.h.

template<typename Main , typename Aux , typename Metadata , typename Tag >
using proxy::details::AssociatedData< Main, Aux, Metadata, Tag >::This_t = AssociatedData<Main, Aux, Metadata, Tag>
private

This type.

Definition at line 782 of file AssociatedData.h.

Constructor & Destructor Documentation

template<typename Main , typename Aux , typename Metadata , typename Tag >
proxy::details::AssociatedData< Main, Aux, Metadata, Tag >::AssociatedData ( group_ranges_t &&  groups)
inline

Definition at line 803 of file AssociatedData.h.

804  : fGroups(std::move(groups))
805  {}
def move(depos, offset)
Definition: depos.py:107

Member Function Documentation

template<typename Main , typename Aux , typename Metadata , typename Tag >
auto proxy::details::AssociatedData< Main, Aux, Metadata, Tag >::begin ( ) const -> decltype(auto)
inline

Returns an iterator pointing to the first associated data range.

Definition at line 808 of file AssociatedData.h.

809  { return fGroups.begin(); }
range_iterator_t begin() const
Returns the begin iterator of the first range.
template<typename Main , typename Aux , typename Metadata , typename Tag >
auto proxy::details::AssociatedData< Main, Aux, Metadata, Tag >::end ( ) const -> decltype(auto)
inline

Returns an iterator pointing past the last associated data range.

Definition at line 812 of file AssociatedData.h.

813  { return fGroups.end(); }
range_iterator_t end() const
Returns the end iterator of the last range.
template<typename Main , typename Aux , typename Metadata , typename Tag >
auto proxy::details::AssociatedData< Main, Aux, Metadata, Tag >::getRange ( std::size_t  i) const -> decltype(auto)
inline

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

Definition at line 816 of file AssociatedData.h.

817  { return util::makeTagged<tag>(fGroups.range(i)); }
range_t range(std::size_t i) const
Returns the specified range in an object holding the iterators.
template<typename Main , typename Aux , typename Metadata , typename Tag >
template<typename TestTag >
static constexpr bool proxy::details::AssociatedData< Main, Aux, Metadata, Tag >::hasTag ( )
inlinestatic

Returns whether this data is labeled with the specified tag.

Definition at line 831 of file AssociatedData.h.

831 { return std::is_same<TestTag, tag>(); }
template<typename Main , typename Aux , typename Metadata , typename Tag >
auto proxy::details::AssociatedData< Main, Aux, Metadata, Tag >::operator[] ( std::size_t  index) const -> decltype(auto)
inline

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

Definition at line 820 of file AssociatedData.h.

821  {
822  static_assert(
823  std::is_convertible<decltype(getRange(index)), auxiliary_data_t>(),
824  "Inconsistent data types."
825  );
826  return getRange(index);
827  }
auto getRange(std::size_t i) const -> decltype(auto)
Returns the range with the specified index (no check performed).
util::add_tag_t< typename group_ranges_t::range_t, tag > auxiliary_data_t
Type of collection of auxiliary data associated with a main item.

Member Data Documentation

template<typename Main , typename Aux , typename Metadata , typename Tag >
group_ranges_t proxy::details::AssociatedData< Main, Aux, Metadata, Tag >::fGroups
private

Definition at line 834 of file AssociatedData.h.


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