ATLAS Offline Software
Public Types | Public Member Functions | Private Attributes | Friends | List of all members
FPGATrackSimGenScanArray< T >::Iterator Struct Reference

#include <FPGATrackSimGenScanArray.h>

Collaboration diagram for FPGATrackSimGenScanArray< T >::Iterator:

Public Types

using value_type = FPGATrackSimGenScanArray< T >::Iterator
 
using iterator_category = std::forward_iterator_tag
 
using container_type = FPGATrackSimGenScanArray< T >
 
using difference_type = void
 
using pointer = FPGATrackSimGenScanArray< T >::Iterator *
 
using reference = FPGATrackSimGenScanArray< T >::Iterator &
 

Public Member Functions

 Iterator (const std::vector< unsigned int > &idx, FPGATrackSimGenScanArray< T > &itrdata)
 
Iteratoroperator* ()
 
Iteratoroperator-> ()
 
Iteratoroperator++ ()
 
const std::vector< unsigned int > & idx () const
 
T & data ()
 
Iterator operator++ (int)
 

Private Attributes

std::vector< unsigned int > m_idx
 
FPGATrackSimGenScanArray< T > & m_itrdata
 

Friends

bool operator== (const Iterator &a, const Iterator &b)
 
bool operator!= (const Iterator &a, const Iterator &b)
 

Detailed Description

template<typename T>
struct FPGATrackSimGenScanArray< T >::Iterator

Definition at line 122 of file FPGATrackSimGenScanArray.h.

Member Typedef Documentation

◆ container_type

Definition at line 126 of file FPGATrackSimGenScanArray.h.

◆ difference_type

template<typename T >
using FPGATrackSimGenScanArray< T >::Iterator::difference_type = void

Definition at line 127 of file FPGATrackSimGenScanArray.h.

◆ iterator_category

template<typename T >
using FPGATrackSimGenScanArray< T >::Iterator::iterator_category = std::forward_iterator_tag

Definition at line 125 of file FPGATrackSimGenScanArray.h.

◆ pointer

Definition at line 128 of file FPGATrackSimGenScanArray.h.

◆ reference

Definition at line 129 of file FPGATrackSimGenScanArray.h.

◆ value_type

Definition at line 124 of file FPGATrackSimGenScanArray.h.

Constructor & Destructor Documentation

◆ Iterator()

template<typename T >
FPGATrackSimGenScanArray< T >::Iterator::Iterator ( const std::vector< unsigned int > &  idx,
FPGATrackSimGenScanArray< T > &  itrdata 
)
inline

Definition at line 132 of file FPGATrackSimGenScanArray.h.

134  : m_idx(idx), m_itrdata(itrdata) {
135  if (m_idx.size() != m_itrdata.dims().size()) {
136  throw std::runtime_error(
137  "FPGATrackSimGenScanArray::Interator array size mismatch in "
138  "constructor");
139  }
140  }

Member Function Documentation

◆ data()

template<typename T >
T& FPGATrackSimGenScanArray< T >::Iterator::data ( )
inline

Definition at line 161 of file FPGATrackSimGenScanArray.h.

161 { return m_itrdata[m_idx]; }

◆ idx()

template<typename T >
const std::vector<unsigned int>& FPGATrackSimGenScanArray< T >::Iterator::idx ( ) const
inline

Definition at line 160 of file FPGATrackSimGenScanArray.h.

160 { return m_idx; }

◆ operator*()

template<typename T >
Iterator& FPGATrackSimGenScanArray< T >::Iterator::operator* ( )
inline

Definition at line 142 of file FPGATrackSimGenScanArray.h.

142 { return *this; }

◆ operator++() [1/2]

template<typename T >
Iterator& FPGATrackSimGenScanArray< T >::Iterator::operator++ ( )
inline

Definition at line 146 of file FPGATrackSimGenScanArray.h.

147  {
148  ++m_idx.at(0);
149  for (unsigned int i = 0; i < m_idx.size() - 1; i++)
150  {
151  if (m_idx.at(i) >= m_itrdata.dims().at(i))
152  {
153  ++m_idx.at(i + 1);
154  m_idx.at(i) = 0;
155  }
156  }
157  return *this;
158  }

◆ operator++() [2/2]

template<typename T >
Iterator FPGATrackSimGenScanArray< T >::Iterator::operator++ ( int  )
inline

Definition at line 164 of file FPGATrackSimGenScanArray.h.

165  {
166  Iterator tmp = *this;
167  ++(*this);
168  return tmp;
169  }

◆ operator->()

template<typename T >
Iterator* FPGATrackSimGenScanArray< T >::Iterator::operator-> ( )
inline

Definition at line 143 of file FPGATrackSimGenScanArray.h.

143 { return this; }

Friends And Related Function Documentation

◆ operator!=

template<typename T >
bool operator!= ( const Iterator a,
const Iterator b 
)
friend

Definition at line 172 of file FPGATrackSimGenScanArray.h.

173  {
174  return a.m_idx != b.m_idx;
175  };

◆ operator==

template<typename T >
bool operator== ( const Iterator a,
const Iterator b 
)
friend

Definition at line 171 of file FPGATrackSimGenScanArray.h.

171 { return a.m_idx == b.m_idx; };

Member Data Documentation

◆ m_idx

template<typename T >
std::vector<unsigned int> FPGATrackSimGenScanArray< T >::Iterator::m_idx
private

Definition at line 179 of file FPGATrackSimGenScanArray.h.

◆ m_itrdata

template<typename T >
FPGATrackSimGenScanArray<T>& FPGATrackSimGenScanArray< T >::Iterator::m_itrdata
private

Definition at line 182 of file FPGATrackSimGenScanArray.h.


The documentation for this struct was generated from the following file:
FPGATrackSimGenScanArray::Iterator::Iterator
Iterator(const std::vector< unsigned int > &idx, FPGATrackSimGenScanArray< T > &itrdata)
Definition: FPGATrackSimGenScanArray.h:132
FPGATrackSimGenScanArray::Iterator::m_idx
std::vector< unsigned int > m_idx
Definition: FPGATrackSimGenScanArray.h:175
FPGATrackSimGenScanArray::Iterator::idx
const std::vector< unsigned int > & idx() const
Definition: FPGATrackSimGenScanArray.h:160
lumiFormat.i
int i
Definition: lumiFormat.py:85
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
FPGATrackSimGenScanArray::Iterator::m_itrdata
FPGATrackSimGenScanArray< T > & m_itrdata
Definition: FPGATrackSimGenScanArray.h:182
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
a
TList * a
Definition: liststreamerinfos.cxx:10