| The Gaudi Framework v28r2p1 (f1a77ff4)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
Gaudi::details::index_iterator< ITERATOR, INDICES > Class Template Reference

"index" iterator iterates ober "indiced" intries in the cotainer/range More...

`#include <GaudiKernel/SmartRanges.h>`

Inheritance diagram for Gaudi::details::index_iterator< ITERATOR, INDICES >:
[legend]
Collaboration diagram for Gaudi::details::index_iterator< ITERATOR, INDICES >:
[legend]

## Public Member Functions
| index_iterator (const INDICES &indices, ITERATOR b, ITERATOR e)
| index_iterator (INDICES &&indices, ITERATOR b, ITERATOR e)
| index_iterator ()

## Private Member Functions
void | increment ()
std::iterator_traits< ITERATOR >::reference | dereference () const
bool | equal (const index_iterator &other) const

## Private Attributes
ITERATOR | m_begin
std::size_t | m_size
INDICES | m_indices
std::size_t | m_index

## Friends
class | boost::iterator_core_access

## Detailed Description

### template<class ITERATOR, class INDICES>
class Gaudi::details::index_iterator< ITERATOR, INDICES >

"index" iterator iterates ober "indiced" intries in the cotainer/range

- INDICES can be something like std::vector<unsigned int>
  Author
    Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@i.nosp@m.tep..nosp@m.ru
  Date
    2016-09-20

Definition at line 108 of file SmartRanges.h.

## Constructor & Destructor Documentation

template<class ITERATOR , class INDICES >

Gaudi::details::index_iterator< ITERATOR, INDICES >::index_iterator | ( | const INDICES & | indices,
|  | ITERATOR | b,
|  | ITERATOR | e
| ) |  |
| inline

Definition at line 117 of file SmartRanges.h.

118 : m_begin ( b )
119 , m_size ( std::distance ( b , e ) )
120 , m_indices ( indices )
121 , m_index ( 0 )
122 {}
std::distance
T distance(T...args)
Gaudi::details::index_iterator::m_begin
ITERATOR m_begin
Definition: SmartRanges.h:169
Gaudi::details::index_iterator::m_size
std::size_t m_size
Definition: SmartRanges.h:170
Gaudi::details::index_iterator::m_indices
INDICES m_indices
Definition: SmartRanges.h:171
Gaudi::details::index_iterator::m_index
std::size_t m_index
Definition: SmartRanges.h:172
template<class ITERATOR , class INDICES >

Gaudi::details::index_iterator< ITERATOR, INDICES >::index_iterator | ( | INDICES && | indices,
|  | ITERATOR | b,
|  | ITERATOR | e
| ) |  |
| inline

Definition at line 124 of file SmartRanges.h.

125 : m_begin ( b )
126 , m_size ( std::distance ( b , e ) )
127 , m_indices ( indices )
128 , m_index ( 0 )
129 {}
std::distance
T distance(T...args)
Gaudi::details::index_iterator::m_begin
ITERATOR m_begin
Definition: SmartRanges.h:169
Gaudi::details::index_iterator::m_size
std::size_t m_size
Definition: SmartRanges.h:170
Gaudi::details::index_iterator::m_indices
INDICES m_indices
Definition: SmartRanges.h:171
Gaudi::details::index_iterator::m_index
std::size_t m_index
Definition: SmartRanges.h:172
template<class ITERATOR , class INDICES >

Gaudi::details::index_iterator< ITERATOR, INDICES >::index_iterator | ( |  | ) |
| inline

Definition at line 131 of file SmartRanges.h.

132 : m_begin ( )
133 , m_size ( 0 )
134 , m_indices ( )
135 , m_index ( 0 )
136 {}
Gaudi::details::index_iterator::m_begin
ITERATOR m_begin
Definition: SmartRanges.h:169
Gaudi::details::index_iterator::m_size
std::size_t m_size
Definition: SmartRanges.h:170
Gaudi::details::index_iterator::m_indices
INDICES m_indices
Definition: SmartRanges.h:171
Gaudi::details::index_iterator::m_index
std::size_t m_index
Definition: SmartRanges.h:172

## Member Function Documentation

template<class ITERATOR , class INDICES >

std::iterator_traits<ITERATOR>::reference Gaudi::details::index_iterator< ITERATOR, INDICES >::dereference | ( |  | ) | const
| inline private

Definition at line 151 of file SmartRanges.h.

152 {
153 ITERATOR it = m_begin ;
154 if ( m_index < m_indices.size() )
155 { it = std::next ( m_begin , m_indices[ m_index ] ) ; }
156 return *it;
157 }
Gaudi::details::index_iterator::m_begin
ITERATOR m_begin
Definition: SmartRanges.h:169
std::next
T next(T...args)
Gaudi::details::index_iterator::m_indices
INDICES m_indices
Definition: SmartRanges.h:171
Gaudi::details::index_iterator::m_index
std::size_t m_index
Definition: SmartRanges.h:172
template<class ITERATOR , class INDICES >

bool Gaudi::details::index_iterator< ITERATOR, INDICES >::equal | ( | const index_iterator< ITERATOR, INDICES > & | other | ) | const
| inline private

Definition at line 159 of file SmartRanges.h.

160 {
161 if ( m_index == other.m_index && m_indices.size() == other.m_indices.size() ) { return true ; }
162 return // special stuff to catch "end"
163 ( m_index == m_indices.size() ) &&
164 ( other.m_index == other.m_indices.size() ) ;
165 }
Gaudi::details::index_iterator::m_indices
INDICES m_indices
Definition: SmartRanges.h:171
Gaudi::details::index_iterator::m_index
std::size_t m_index
Definition: SmartRanges.h:172
template<class ITERATOR , class INDICES >

void Gaudi::details::index_iterator< ITERATOR, INDICES >::increment | ( |  | ) |
| inline private

Definition at line 141 of file SmartRanges.h.

142 {
143 if ( m_index < m_indices.size() )
144 {
145 // 1. advance
146 ++m_index ;
147 // 2. advance further, if out of range
148 if ( m_size <= m_indices[m_index] ) { increment () ; }
149 }
150 }
Gaudi::details::index_iterator::m_size
std::size_t m_size
Definition: SmartRanges.h:170
Gaudi::details::index_iterator::increment
void increment()
Definition: SmartRanges.h:141
Gaudi::details::index_iterator::m_indices
INDICES m_indices
Definition: SmartRanges.h:171
Gaudi::details::index_iterator::m_index
std::size_t m_index
Definition: SmartRanges.h:172

## Friends And Related Function Documentation

template<class ITERATOR , class INDICES >

friend class boost::iterator_core_access
| friend

Definition at line 140 of file SmartRanges.h.

## Member Data Documentation

template<class ITERATOR , class INDICES >

ITERATOR Gaudi::details::index_iterator< ITERATOR, INDICES >::m_begin
| private

Definition at line 169 of file SmartRanges.h.

template<class ITERATOR , class INDICES >

std::size_t Gaudi::details::index_iterator< ITERATOR, INDICES >::m_index
| private

Definition at line 172 of file SmartRanges.h.

template<class ITERATOR , class INDICES >

INDICES Gaudi::details::index_iterator< ITERATOR, INDICES >::m_indices
| private

Definition at line 171 of file SmartRanges.h.

template<class ITERATOR , class INDICES >

std::size_t Gaudi::details::index_iterator< ITERATOR, INDICES >::m_size
| private

Definition at line 170 of file SmartRanges.h.

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

- GaudiKernel/GaudiKernel/SmartRanges.h