LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
proxy::details::assns_node_iterator< ArtAssnsIter > Class Template Reference

#include "AssociatedData.h"

Inheritance diagram for proxy::details::assns_node_iterator< ArtAssnsIter >:
proxy::details::IteratorWrapperBase< assns_node_iterator< ArtAssnsIter >, ArtAssnsIter, AssnsIterTraits< ArtAssnsIter >::node_t >

Public Types

using iterator = assns_node_iterator< ArtAssnsIter >
 
Iterator traits

!< The type of base iterator wrapper.

using value_type = AssnsIterTraits< ArtAssnsIter >::node_t
 
using pointer = std::add_pointer_t< value_type >
 
using reference = std::add_lvalue_reference_t< value_type >
 
using iterator_category = std::forward_iterator_tag
 

Public Member Functions

 assns_node_iterator (base_iterator_t const &from)
 Constructor from a base iterator (explicitly allowed). More...
 
AssnsNode_t const & info () const
 Returns the full information the iterator points to. More...
 
AssnsNode_t const & operator() () const
 Returns the full information the iterator points to. More...
 
iteratoroperator++ ()
 Prefix increment operator. More...
 
bool operator!= (data_iterator_t const &other) const
 Comparison with a data iterator (makes unnecessary to wrap end iterators). More...
 
bool operator!= (iterator const &other) const
 Comparison with another iterator. More...
 
auto operator[] (std::size_t index) const -> decltype(auto)
 
auto operator* () const -> decltype(auto)
 Dereference operator; need to be redefined by derived classes. More...
 
auto operator-> () const -> decltype(auto)
 Dereference operator; need to be redefined by derived classes. More...
 

Static Public Member Functions

static AssnsNode_t const & transform (art_assns_iter_t const &v)
 

Protected Types

using data_iterator_t = ArtAssnsIter
 

Protected Member Functions

data_iterator_t const & asDataIterator () const
 

Private Types

using base_iterator_t = IteratorWrapperBase< assns_node_iterator< ArtAssnsIter >, ArtAssnsIter, typename AssnsIterTraits< ArtAssnsIter >::node_t >
 
using art_assns_iter_t = ArtAssnsIter
 
using traits_t = AssnsIterTraits< art_assns_iter_t >
 
using AssnsNode_t = typename traits_t::node_t
 Type of node for this association iterator. More...
 
using ArtAssnsNode_t = typename traits_t::art_node_t
 

Access to the full association information

This interface is a replica of the one of AssnsNode_t.

using main_t = typename AssnsNode_t::main_t
 Returns the art pointer to the associated value. More...
 
using value_t = typename AssnsNode_t::value_t
 Returns the art pointer to the associated value. More...
 
using data_t = typename AssnsNode_t::data_t
 Returns the art pointer to the associated value. More...
 
using mainptr_t = typename AssnsNode_t::mainptr_t
 Returns the art pointer to the associated value. More...
 
using valueptr_t = typename AssnsNode_t::valueptr_t
 Returns the art pointer to the associated value. More...
 
using dataptr_t = typename AssnsNode_t::dataptr_t
 Returns the art pointer to the associated value. More...
 
valueptr_t valuePtr () const
 Returns the art pointer to the associated value. More...
 
value_t const & value () const
 Returns the art pointer to the associated value. More...
 
mainptr_t mainPtr () const
 Returns the art pointer to the main value, key of the association. More...
 
main_t const & main () const
 Returns the main value, key of the association. More...
 
template<typename ArtNode = ArtAssnsNode_t>
std::enable_if_t< hasMetadata< ArtNode >), dataptr_tdataPtr () const
 Returns the pointer to the metadata on this association node. More...
 
template<typename ArtNode = ArtAssnsNode_t>
std::enable_if_t< hasMetadata< ArtNode >), typename lar::util::assns_traits< ArtNode >::data_t const & > data () const
 Returns a reference to the metadata on this association node. More...
 
template<typename Node = AssnsNode_t>
static constexpr bool hasMetadata ()
 Returns whether this node type supports metadata. More...
 

Detailed Description

template<typename ArtAssnsIter>
class proxy::details::assns_node_iterator< ArtAssnsIter >

Modified iterator returning a association node interface. The basic iterator interface is to the associated (right) art pointer.

Definition at line 391 of file AssociatedData.h.

Member Typedef Documentation

template<typename ArtAssnsIter >
using proxy::details::assns_node_iterator< ArtAssnsIter >::art_assns_iter_t = ArtAssnsIter
private

Definition at line 399 of file AssociatedData.h.

template<typename ArtAssnsIter >
using proxy::details::assns_node_iterator< ArtAssnsIter >::ArtAssnsNode_t = typename traits_t::art_node_t
private

Definition at line 404 of file AssociatedData.h.

template<typename ArtAssnsIter >
using proxy::details::assns_node_iterator< ArtAssnsIter >::AssnsNode_t = typename traits_t::node_t
private

Type of node for this association iterator.

Definition at line 403 of file AssociatedData.h.

template<typename ArtAssnsIter >
using proxy::details::assns_node_iterator< ArtAssnsIter >::base_iterator_t = IteratorWrapperBase<assns_node_iterator<ArtAssnsIter>, ArtAssnsIter, typename AssnsIterTraits<ArtAssnsIter>::node_t>
private

Definition at line 397 of file AssociatedData.h.

using proxy::details::IteratorWrapperBase< assns_node_iterator< ArtAssnsIter > , ArtAssnsIter , AssnsIterTraits< ArtAssnsIter >::node_t >::data_iterator_t = ArtAssnsIter
protectedinherited

Definition at line 99 of file AssociatedData.h.

template<typename ArtAssnsIter >
using proxy::details::assns_node_iterator< ArtAssnsIter >::data_t = typename AssnsNode_t::data_t

Returns the art pointer to the associated value.

Definition at line 425 of file AssociatedData.h.

template<typename ArtAssnsIter >
using proxy::details::assns_node_iterator< ArtAssnsIter >::dataptr_t = typename AssnsNode_t::dataptr_t

Returns the art pointer to the associated value.

Definition at line 428 of file AssociatedData.h.

using proxy::details::IteratorWrapperBase< assns_node_iterator< ArtAssnsIter > , ArtAssnsIter , AssnsIterTraits< ArtAssnsIter >::node_t >::iterator = assns_node_iterator< ArtAssnsIter >
inherited

Definition at line 102 of file AssociatedData.h.

using proxy::details::IteratorWrapperBase< assns_node_iterator< ArtAssnsIter > , ArtAssnsIter , AssnsIterTraits< ArtAssnsIter >::node_t >::iterator_category = std::forward_iterator_tag
inherited

Definition at line 110 of file AssociatedData.h.

template<typename ArtAssnsIter >
using proxy::details::assns_node_iterator< ArtAssnsIter >::main_t = typename AssnsNode_t::main_t

Returns the art pointer to the associated value.

Definition at line 423 of file AssociatedData.h.

template<typename ArtAssnsIter >
using proxy::details::assns_node_iterator< ArtAssnsIter >::mainptr_t = typename AssnsNode_t::mainptr_t

Returns the art pointer to the associated value.

Definition at line 426 of file AssociatedData.h.

using proxy::details::IteratorWrapperBase< assns_node_iterator< ArtAssnsIter > , ArtAssnsIter , AssnsIterTraits< ArtAssnsIter >::node_t >::pointer = std::add_pointer_t<value_type>
inherited

Definition at line 108 of file AssociatedData.h.

using proxy::details::IteratorWrapperBase< assns_node_iterator< ArtAssnsIter > , ArtAssnsIter , AssnsIterTraits< ArtAssnsIter >::node_t >::reference = std::add_lvalue_reference_t<value_type>
inherited

Definition at line 109 of file AssociatedData.h.

template<typename ArtAssnsIter >
using proxy::details::assns_node_iterator< ArtAssnsIter >::traits_t = AssnsIterTraits<art_assns_iter_t>
private

Definition at line 400 of file AssociatedData.h.

template<typename ArtAssnsIter >
using proxy::details::assns_node_iterator< ArtAssnsIter >::value_t = typename AssnsNode_t::value_t

Returns the art pointer to the associated value.

Definition at line 424 of file AssociatedData.h.

using proxy::details::IteratorWrapperBase< assns_node_iterator< ArtAssnsIter > , ArtAssnsIter , AssnsIterTraits< ArtAssnsIter >::node_t >::value_type = AssnsIterTraits< ArtAssnsIter >::node_t
inherited

Definition at line 107 of file AssociatedData.h.

template<typename ArtAssnsIter >
using proxy::details::assns_node_iterator< ArtAssnsIter >::valueptr_t = typename AssnsNode_t::valueptr_t

Returns the art pointer to the associated value.

Definition at line 427 of file AssociatedData.h.

Constructor & Destructor Documentation

template<typename ArtAssnsIter >
proxy::details::assns_node_iterator< ArtAssnsIter >::assns_node_iterator ( base_iterator_t const &  from)
inline

Constructor from a base iterator (explicitly allowed).

Definition at line 410 of file AssociatedData.h.

410 : base_iterator_t(from) {}
IteratorWrapperBase< assns_node_iterator< ArtAssnsIter >, ArtAssnsIter, typename AssnsIterTraits< ArtAssnsIter >::node_t > base_iterator_t

Member Function Documentation

data_iterator_t const& proxy::details::IteratorWrapperBase< assns_node_iterator< ArtAssnsIter > , ArtAssnsIter , AssnsIterTraits< ArtAssnsIter >::node_t >::asDataIterator ( ) const
inlineprotectedinherited
template<typename ArtAssnsIter >
template<typename ArtNode = ArtAssnsNode_t>
std::enable_if_t<hasMetadata<ArtNode>), typename lar::util::assns_traits<ArtNode>::data_t const&> proxy::details::assns_node_iterator< ArtAssnsIter >::data ( ) const
inline

Returns a reference to the metadata on this association node.

Definition at line 461 of file AssociatedData.h.

462  {
463  return info().data();
464  }
AssnsNode_t const & info() const
Returns the full information the iterator points to.
template<typename ArtAssnsIter >
template<typename ArtNode = ArtAssnsNode_t>
std::enable_if_t<hasMetadata<ArtNode>), dataptr_t> proxy::details::assns_node_iterator< ArtAssnsIter >::dataPtr ( ) const
inline

Returns the pointer to the metadata on this association node.

Definition at line 452 of file AssociatedData.h.

453  {
454  return info().dataPtr();
455  }
AssnsNode_t const & info() const
Returns the full information the iterator points to.
template<typename ArtAssnsIter >
template<typename Node = AssnsNode_t>
static constexpr bool proxy::details::assns_node_iterator< ArtAssnsIter >::hasMetadata ( )
inlinestatic

Returns whether this node type supports metadata.

Definition at line 445 of file AssociatedData.h.

446  {
447  return lar::util::assns_has_metadata_v<Node>;
448  }
template<typename ArtAssnsIter >
AssnsNode_t const& proxy::details::assns_node_iterator< ArtAssnsIter >::info ( ) const
inline

Returns the full information the iterator points to.

Definition at line 413 of file AssociatedData.h.

References operator*().

413 { return base_iterator_t::operator*(); }
auto operator*() const -> decltype(auto)
Dereference operator; need to be redefined by derived classes.
template<typename ArtAssnsIter >
main_t const& proxy::details::assns_node_iterator< ArtAssnsIter >::main ( ) const
inline

Returns the main value, key of the association.

Definition at line 440 of file AssociatedData.h.

440 { return info().main(); }
AssnsNode_t const & info() const
Returns the full information the iterator points to.
template<typename ArtAssnsIter >
mainptr_t proxy::details::assns_node_iterator< ArtAssnsIter >::mainPtr ( ) const
inline

Returns the art pointer to the main value, key of the association.

Definition at line 437 of file AssociatedData.h.

437 { return info().mainPtr(); }
AssnsNode_t const & info() const
Returns the full information the iterator points to.
bool proxy::details::IteratorWrapperBase< assns_node_iterator< ArtAssnsIter > , ArtAssnsIter , AssnsIterTraits< ArtAssnsIter >::node_t >::operator!= ( data_iterator_t const &  other) const
inlineinherited

Comparison with a data iterator (makes unnecessary to wrap end iterators).

Definition at line 127 of file AssociatedData.h.

References proxy::details::IteratorWrapperBase< Iter, DataIter, ValueType >::asDataIterator().

bool proxy::details::IteratorWrapperBase< assns_node_iterator< ArtAssnsIter > , ArtAssnsIter , AssnsIterTraits< ArtAssnsIter >::node_t >::operator!= ( iterator const &  other) const
inlineinherited

Comparison with another iterator.

Definition at line 130 of file AssociatedData.h.

References proxy::details::IteratorWrapperBase< Iter, DataIter, ValueType >::asDataIterator(), and proxy::details::IteratorWrapperBase< Iter, DataIter, ValueType >::operator!=().

130 { return operator!=(other.asDataIterator()); }
bool operator!=(data_iterator_t const &other) const
Comparison with a data iterator (makes unnecessary to wrap end iterators).
template<typename ArtAssnsIter >
AssnsNode_t const& proxy::details::assns_node_iterator< ArtAssnsIter >::operator() ( ) const
inline

Returns the full information the iterator points to.

Definition at line 416 of file AssociatedData.h.

416 { return info(); }
AssnsNode_t const & info() const
Returns the full information the iterator points to.
iterator& proxy::details::IteratorWrapperBase< assns_node_iterator< ArtAssnsIter > , ArtAssnsIter , AssnsIterTraits< ArtAssnsIter >::node_t >::operator++ ( )
inlineinherited

Prefix increment operator.

Definition at line 120 of file AssociatedData.h.

References proxy::details::IteratorWrapperBase< Iter, DataIter, ValueType >::asIterator().

121  {
122  data_iterator_t::operator++();
123  return asIterator();
124  }
auto proxy::details::IteratorWrapperBase< assns_node_iterator< ArtAssnsIter > , ArtAssnsIter , AssnsIterTraits< ArtAssnsIter >::node_t >::operator-> ( ) const-> decltype(auto)
inlineinherited

Dereference operator; need to be redefined by derived classes.

Definition at line 141 of file AssociatedData.h.

References proxy::details::IteratorWrapperBase< Iter, DataIter, ValueType >::makeValuePointer().

template<typename ArtAssnsIter >
static AssnsNode_t const& proxy::details::assns_node_iterator< ArtAssnsIter >::transform ( art_assns_iter_t const &  v)
inlinestatic

Definition at line 486 of file AssociatedData.h.

References proxy::details::makeAssnsNode().

486 { return makeAssnsNode(*v); }
AssnsNode< ArtAssnsIterValue > const & makeAssnsNode(ArtAssnsIterValue const &from)
Reinterprets the specified association node as a AssnsNode.
template<typename ArtAssnsIter >
value_t const& proxy::details::assns_node_iterator< ArtAssnsIter >::value ( ) const
inline

Returns the art pointer to the associated value.

Definition at line 434 of file AssociatedData.h.

434 { return info().value(); }
AssnsNode_t const & info() const
Returns the full information the iterator points to.
template<typename ArtAssnsIter >
valueptr_t proxy::details::assns_node_iterator< ArtAssnsIter >::valuePtr ( ) const
inline

Returns the art pointer to the associated value.

Definition at line 431 of file AssociatedData.h.

431 { return info().valuePtr(); }
AssnsNode_t const & info() const
Returns the full information the iterator points to.

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