LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::const_iterator Class Reference

#include "CountersMap.h"

Inheritance diagram for lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::const_iterator:

Public Types

using value_type = typename CounterMap_t::value_type
 value type: pair More...
 
using difference_type = std::ptrdiff_t
 
using pointer = const value_type *
 
using reference = const value_type &
 
using iterator_category = std::bidirectional_iterator_tag
 
using iterator_type = CounterMap_t::const_iterator
 this type More...
 

Public Member Functions

 const_iterator ()=default
 Default constructor. More...
 
value_type operator* () const
 Access to the pointed pair. More...
 
iterator_typeoperator++ ()
 
iterator_type operator++ (int)
 
iterator_typeoperator-- ()
 
iterator_type operator-- (int)
 
bool operator== (const iterator_type &as) const
 
bool operator!= (const iterator_type &as) const
 
CounterKey_t key () const
 Returns the key of the pointed item as a CounterKey_t. More...
 

Protected Member Functions

 const_iterator (typename BaseMap_t::const_iterator it, size_t ix)
 Private constructor (from a map iterator and a block index) More...
 

Protected Attributes

BaseMap_t::const_iterator iter
 iterator to the block of counters More...
 
CounterIndex_t index
 index of the counted in the subblock More...
 

Private Attributes

friend CountersMap< K, C, S, A, SUB >
 

Detailed Description

template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
class lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::const_iterator

Definition at line 430 of file CountersMap.h.

Member Typedef Documentation

template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
using lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::const_iterator::difference_type = std::ptrdiff_t

Definition at line 435 of file CountersMap.h.

template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
using lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::const_iterator::iterator_category = std::bidirectional_iterator_tag

Definition at line 438 of file CountersMap.h.

template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
using lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::const_iterator::iterator_type = CounterMap_t::const_iterator

this type

Definition at line 440 of file CountersMap.h.

template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
using lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::const_iterator::pointer = const value_type*

Definition at line 436 of file CountersMap.h.

template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
using lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::const_iterator::reference = const value_type&

Definition at line 437 of file CountersMap.h.

template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
using lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::const_iterator::value_type = typename CounterMap_t::value_type

value type: pair

Definition at line 434 of file CountersMap.h.

Constructor & Destructor Documentation

template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::const_iterator::const_iterator ( )
default

Default constructor.

template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::const_iterator::const_iterator ( typename BaseMap_t::const_iterator  it,
size_t  ix 
)
inlineprotected

Private constructor (from a map iterator and a block index)

Definition at line 498 of file CountersMap.h.

498 : iter(it), index(ix) {}
CounterIndex_t index
index of the counted in the subblock
Definition: CountersMap.h:495
BaseMap_t::const_iterator iter
iterator to the block of counters
Definition: CountersMap.h:493

Member Function Documentation

template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
CounterKey_t lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::const_iterator::key ( ) const
inline

Returns the key of the pointed item as a CounterKey_t.

Definition at line 490 of file CountersMap.h.

490 { return {iter->first, index}; }
CounterIndex_t index
index of the counted in the subblock
Definition: CountersMap.h:495
BaseMap_t::const_iterator iter
iterator to the block of counters
Definition: CountersMap.h:493
template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
bool lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::const_iterator::operator!= ( const iterator_type as) const
inline

Definition at line 484 of file CountersMap.h.

References lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::const_iterator::index, and lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::const_iterator::iter.

485  {
486  return (iter != as.iter) || (index != as.index);
487  }
CounterIndex_t index
index of the counted in the subblock
Definition: CountersMap.h:495
BaseMap_t::const_iterator iter
iterator to the block of counters
Definition: CountersMap.h:493
template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
value_type lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::const_iterator::operator* ( ) const
inline

Access to the pointed pair.

Definition at line 446 of file CountersMap.h.

446 { return {key(), iter->second[index]}; }
CounterIndex_t index
index of the counted in the subblock
Definition: CountersMap.h:495
BaseMap_t::const_iterator iter
iterator to the block of counters
Definition: CountersMap.h:493
CounterKey_t key() const
Returns the key of the pointed item as a CounterKey_t.
Definition: CountersMap.h:490
template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
iterator_type& lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::const_iterator::operator++ ( )
inline

Definition at line 448 of file CountersMap.h.

449  {
450  if (++index >= NSubcounters) {
451  ++iter;
452  index = 0;
453  }
454  return *this;
455  } // operator++
CounterIndex_t index
index of the counted in the subblock
Definition: CountersMap.h:495
BaseMap_t::const_iterator iter
iterator to the block of counters
Definition: CountersMap.h:493
static constexpr size_t NSubcounters
Number of subcounters in one counter block.
Definition: CountersMap.h:149
template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
iterator_type lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::const_iterator::operator++ ( int  )
inline

Definition at line 456 of file CountersMap.h.

457  {
458  iterator_type old(*this);
459  this->operator++();
460  return old;
461  }
CounterMap_t::const_iterator iterator_type
this type
Definition: CountersMap.h:440
template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
iterator_type& lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::const_iterator::operator-- ( )
inline

Definition at line 463 of file CountersMap.h.

464  {
465  if (index == 0) {
466  --iter;
467  index = NSubcounters - 1;
468  }
469  else
470  --index;
471  return *this;
472  } // operator--()
CounterIndex_t index
index of the counted in the subblock
Definition: CountersMap.h:495
BaseMap_t::const_iterator iter
iterator to the block of counters
Definition: CountersMap.h:493
static constexpr size_t NSubcounters
Number of subcounters in one counter block.
Definition: CountersMap.h:149
template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
iterator_type lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::const_iterator::operator-- ( int  )
inline

Definition at line 473 of file CountersMap.h.

474  {
475  iterator_type old(*this);
476  this->operator--();
477  return old;
478  }
CounterMap_t::const_iterator iterator_type
this type
Definition: CountersMap.h:440
template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
bool lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::const_iterator::operator== ( const iterator_type as) const
inline

Definition at line 480 of file CountersMap.h.

References lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::const_iterator::index, and lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::const_iterator::iter.

481  {
482  return (iter == as.iter) && (index == as.index);
483  }
CounterIndex_t index
index of the counted in the subblock
Definition: CountersMap.h:495
BaseMap_t::const_iterator iter
iterator to the block of counters
Definition: CountersMap.h:493

Member Data Documentation

template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
friend lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::const_iterator::CountersMap< K, C, S, A, SUB >
private

Definition at line 431 of file CountersMap.h.

template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
CounterIndex_t lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::const_iterator::index
protected
template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
BaseMap_t::const_iterator lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::const_iterator::iter
protected

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