LArSoft  v06_85_00
Liquid Argon Software toolkit - http://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 435 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 442 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 445 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 447 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 443 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 444 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 441 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 487 of file CountersMap.h.

487  :
488  iter(it), index(ix) {}
CounterIndex_t index
index of the counted in the subblock
Definition: CountersMap.h:484
BaseMap_t::const_iterator iter
iterator to the block of counters
Definition: CountersMap.h:482

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 479 of file CountersMap.h.

479 { return { iter->first, index }; }
CounterIndex_t index
index of the counted in the subblock
Definition: CountersMap.h:484
BaseMap_t::const_iterator iter
iterator to the block of counters
Definition: CountersMap.h:482
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 474 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.

475  { return (iter != as.iter) || (index != as.index); }
CounterIndex_t index
index of the counted in the subblock
Definition: CountersMap.h:484
BaseMap_t::const_iterator iter
iterator to the block of counters
Definition: CountersMap.h:482
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 453 of file CountersMap.h.

453 { return { key(), iter->second[index] }; }
CounterIndex_t index
index of the counted in the subblock
Definition: CountersMap.h:484
BaseMap_t::const_iterator iter
iterator to the block of counters
Definition: CountersMap.h:482
CounterKey_t key() const
Returns the key of the pointed item as a CounterKey_t.
Definition: CountersMap.h:479
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 455 of file CountersMap.h.

456  {
457  if (++index >= NSubcounters) { ++iter; index = 0; }
458  return *this;
459  } // operator++
CounterIndex_t index
index of the counted in the subblock
Definition: CountersMap.h:484
BaseMap_t::const_iterator iter
iterator to the block of counters
Definition: CountersMap.h:482
static constexpr size_t NSubcounters
Number of subcounters in one counter block.
Definition: CountersMap.h:159
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 460 of file CountersMap.h.

461  { iterator_type old(*this); this->operator++(); return old; }
CounterMap_t::const_iterator iterator_type
this type
Definition: CountersMap.h:447
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) { --iter; index = NSubcounters - 1; }
466  else --index;
467  return *this;
468  } // operator--()
CounterIndex_t index
index of the counted in the subblock
Definition: CountersMap.h:484
BaseMap_t::const_iterator iter
iterator to the block of counters
Definition: CountersMap.h:482
static constexpr size_t NSubcounters
Number of subcounters in one counter block.
Definition: CountersMap.h:159
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 469 of file CountersMap.h.

470  { iterator_type old(*this); this->operator--(); return old; }
CounterMap_t::const_iterator iterator_type
this type
Definition: CountersMap.h:447
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 472 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.

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

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 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>
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: