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 82 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 88 of file AlgsExecutionStates.h.

88  : s_(s), v_(&v) {
89  if(pos == POS::BEGIN)
90  pos_ = std::find(v_->begin(),v_->end(), s_);
91  if(pos == POS::END)
92  pos_ = v_->end();
93  //std::cout << "initialized iterator at " << pos_ << std::endl;
94  }
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:245
AlgsExecutionStates::Iterator::~Iterator ( )
inline

Definition at line 96 of file AlgsExecutionStates.h.

96 {}

Member Function Documentation

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

Definition at line 109 of file AlgsExecutionStates.h.

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

Definition at line 125 of file AlgsExecutionStates.h.

125  {
126  return std::distance(v_->begin(), pos_);
127  }
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 113 of file AlgsExecutionStates.h.

113  {
114  if (pos_ != v_->end()){
115  pos_ = std::find(++pos_, v_->end(), s_);
116  //std::cout << "advanced iterator to " << pos_ << std::endl;
117  }
118  return(*this);
119  }
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 121 of file AlgsExecutionStates.h.

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

Definition at line 98 of file AlgsExecutionStates.h.

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

Definition at line 105 of file AlgsExecutionStates.h.

105  {
106  return pos_ == other.pos_ && s_ == other.s_ && v_ == other.v_;
107  }
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 130 of file AlgsExecutionStates.h.

State AlgsExecutionStates::Iterator::s_
private

Definition at line 131 of file AlgsExecutionStates.h.

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

Definition at line 132 of file AlgsExecutionStates.h.


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