Version: SMASH-3.1
smash::I_tot_range::iterator Class Reference

#include <clebschgordan.h>

Iterator class for determination of total isospin.

See documentation of smash::Particles::GenericIterator class for more information about exposed types.

Definition at line 122 of file clebschgordan.h.

Public Types

using iterator_category = std::forward_iterator_tag
 Required by STL: expose iterator_category More...
 
using value_type = int
 Required by STL: expose value_type More...
 
using difference_type = int
 Required by STL: expose difference_type More...
 
using pointer = int *
 Required by STL: expose pointer More...
 
using reference = int &
 Required by STL: expose reference More...
 

Public Member Functions

 iterator (int start, I_tot_range &parent)
 Construct an iterator. More...
 
int operator* ()
 
const iteratoroperator++ ()
 
iterator operator++ (int)
 
bool operator== (const iterator &other)
 
bool operator!= (const iterator &other)
 

Private Attributes

int c_
 Element of the iterator. More...
 
I_tot_rangeparent_
 Parent class giving the total isospin range. More...
 

Member Typedef Documentation

◆ iterator_category

using smash::I_tot_range::iterator::iterator_category = std::forward_iterator_tag

Required by STL: expose iterator_category

Definition at line 131 of file clebschgordan.h.

◆ value_type

Required by STL: expose value_type

Definition at line 133 of file clebschgordan.h.

◆ difference_type

Required by STL: expose difference_type

Definition at line 135 of file clebschgordan.h.

◆ pointer

Required by STL: expose pointer

Definition at line 137 of file clebschgordan.h.

◆ reference

Required by STL: expose reference

Definition at line 139 of file clebschgordan.h.

Constructor & Destructor Documentation

◆ iterator()

smash::I_tot_range::iterator::iterator ( int  start,
I_tot_range parent 
)
inline

Construct an iterator.

Parameters
startInitial value.
parentParent class giving the total isospin range.
Returns
The constructed iterator.

Definition at line 146 of file clebschgordan.h.

146 : c_(start), parent_(parent) {}
I_tot_range & parent_
Parent class giving the total isospin range.
int c_
Element of the iterator.

Member Function Documentation

◆ operator*()

int smash::I_tot_range::iterator::operator* ( )
inline
Returns
Current element of the iterator.

Definition at line 148 of file clebschgordan.h.

148 { return c_; }

◆ operator++() [1/2]

const iterator* smash::I_tot_range::iterator::operator++ ( )
inline
Returns
Next element of the iterator.

Definition at line 150 of file clebschgordan.h.

150  {
151  c_ -= 2;
152  return this;
153  }

◆ operator++() [2/2]

iterator smash::I_tot_range::iterator::operator++ ( int  )
inline
Returns
Next element of the iterator.

Definition at line 155 of file clebschgordan.h.

155  {
156  c_ -= 2;
157  return iterator(c_ + 2, parent_);
158  }
iterator(int start, I_tot_range &parent)
Construct an iterator.

◆ operator==()

bool smash::I_tot_range::iterator::operator== ( const iterator other)
inline
Parameters
otherOther iterator.
Returns
Whether both iterators are equal.

Definition at line 163 of file clebschgordan.h.

163 { return c_ == other.c_; }

◆ operator!=()

bool smash::I_tot_range::iterator::operator!= ( const iterator other)
inline
Parameters
otherOther iterator.
Returns
Whether both iterators are not equal.

Definition at line 168 of file clebschgordan.h.

168 { return c_ != other.c_; }

Member Data Documentation

◆ c_

int smash::I_tot_range::iterator::c_
private

Element of the iterator.

Definition at line 125 of file clebschgordan.h.

◆ parent_

I_tot_range& smash::I_tot_range::iterator::parent_
private

Parent class giving the total isospin range.

Definition at line 127 of file clebschgordan.h.


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