The Gaudi Framework  v29r0 (ff2e7097)
AlgsExecutionStates::Iterator Class Reference

#include <src/AlgsExecutionStates.h>

Inheritance diagram for AlgsExecutionStates::Iterator:
Collaboration diagram for AlgsExecutionStates::Iterator:

Public Types

enum  POS { BEGIN, END }
 

Public Member Functions

 Iterator (POS pos, State s, const std::vector< State > &v)
 
 ~Iterator ()
 
Iteratoroperator= (const Iterator &other)
 
bool operator== (const Iterator &other)
 
bool operator!= (const Iterator &other)
 
Iteratoroperator++ ()
 
Iteratoroperator++ (int)
 
uint operator* ()
 

Private Attributes

std::vector< State >::const_iterator pos_
 
State s_
 
const std::vector< State > * v_
 

Detailed Description

Definition at line 79 of file AlgsExecutionStates.h.

Member Enumeration Documentation

enum AlgsExecutionStates::Iterator::POS

Constructor & Destructor Documentation

AlgsExecutionStates::Iterator::Iterator ( POS  pos,
State  s,
const std::vector< State > &  v 
)
inline

Definition at line 85 of file AlgsExecutionStates.h.

85  : s_( s ), v_( &v )
86  {
87  if ( pos == POS::BEGIN ) pos_ = std::find( v_->begin(), v_->end(), s_ );
88  if ( pos == POS::END ) pos_ = v_->end();
89  // std::cout << "initialized iterator at " << pos_ << std::endl;
90  }
const std::vector< State > * v_
T end(T...args)
std::vector< State >::const_iterator pos_
T find(T...args)
T begin(T...args)
string s
Definition: gaudirun.py:253
AlgsExecutionStates::Iterator::~Iterator ( )
inline

Definition at line 92 of file AlgsExecutionStates.h.

92 {}

Member Function Documentation

bool AlgsExecutionStates::Iterator::operator!= ( const Iterator other)
inline

Definition at line 104 of file AlgsExecutionStates.h.

104 { return pos_ != other.pos_ || s_ != other.s_ || v_ != other.v_; }
const std::vector< State > * v_
std::vector< State >::const_iterator pos_
uint AlgsExecutionStates::Iterator::operator* ( )
inline

Definition at line 117 of file AlgsExecutionStates.h.

117 { return std::distance( v_->begin(), pos_ ); }
T distance(T...args)
const std::vector< State > * v_
std::vector< State >::const_iterator pos_
T begin(T...args)
Iterator& AlgsExecutionStates::Iterator::operator++ ( )
inline

Definition at line 106 of file AlgsExecutionStates.h.

107  {
108  if ( pos_ != v_->end() ) {
109  pos_ = std::find( ++pos_, v_->end(), s_ );
110  // std::cout << "advanced iterator to " << pos_ << std::endl;
111  }
112  return ( *this );
113  }
const std::vector< State > * v_
T end(T...args)
std::vector< State >::const_iterator pos_
T find(T...args)
Iterator& AlgsExecutionStates::Iterator::operator++ ( int  )
inline

Definition at line 115 of file AlgsExecutionStates.h.

115 { return ( ++( *this ) ); }
Iterator& AlgsExecutionStates::Iterator::operator= ( const Iterator other)
inline

Definition at line 94 of file AlgsExecutionStates.h.

95  {
96  pos_ = other.pos_;
97  v_ = other.v_;
98  s_ = other.s_;
99  return ( *this );
100  }
const std::vector< State > * v_
std::vector< State >::const_iterator pos_
bool AlgsExecutionStates::Iterator::operator== ( const Iterator other)
inline

Definition at line 102 of file AlgsExecutionStates.h.

102 { return pos_ == other.pos_ && s_ == other.s_ && v_ == other.v_; }
const std::vector< State > * v_
std::vector< State >::const_iterator pos_

Member Data Documentation

std::vector<State>::const_iterator AlgsExecutionStates::Iterator::pos_
private

Definition at line 120 of file AlgsExecutionStates.h.

State AlgsExecutionStates::Iterator::s_
private

Definition at line 121 of file AlgsExecutionStates.h.

const std::vector<State>* AlgsExecutionStates::Iterator::v_
private

Definition at line 122 of file AlgsExecutionStates.h.


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