ATLAS Offline Software
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
LArBadChanImpl::combined_ordered_iterator< Iter, CMP > Class Template Reference

#include <combined_ordered_iterator.h>

Collaboration diagram for LArBadChanImpl::combined_ordered_iterator< Iter, CMP >:

Public Types

typedef Iter::value_type value_type
 

Public Member Functions

 combined_ordered_iterator (const Iter &b1, const Iter &e1, const Iter &b2, const Iter &e2, const CMP &cmp)
 
 combined_ordered_iterator ()
 
combined_ordered_iteratoroperator++ ()
 
combined_ordered_iterator operator++ (int)
 
const value_typeoperator* ()
 
 operator bool () const
 
bool operator!= (const combined_ordered_iterator &other) const
 
bool operator== (const combined_ordered_iterator &other) const
 

Private Member Functions

const value_typeother () const
 
const value_typecurrent () const
 
const Iter & current_iter () const
 
const value_typenext_in_same () const
 
void advance ()
 
bool at_the_end () const
 
bool other_at_the_end () const
 
void switch_to_other ()
 

Private Attributes

Iter m_b1
 
Iter m_e1
 
Iter m_b2
 
Iter m_e2
 
CMP m_cmp
 
bool m_first
 

Detailed Description

template<class Iter, class CMP>
class LArBadChanImpl::combined_ordered_iterator< Iter, CMP >

Definition at line 18 of file combined_ordered_iterator.h.

Member Typedef Documentation

◆ value_type

template<class Iter , class CMP >
typedef Iter::value_type LArBadChanImpl::combined_ordered_iterator< Iter, CMP >::value_type

Definition at line 21 of file combined_ordered_iterator.h.

Constructor & Destructor Documentation

◆ combined_ordered_iterator() [1/2]

template<class Iter , class CMP >
LArBadChanImpl::combined_ordered_iterator< Iter, CMP >::combined_ordered_iterator ( const Iter &  b1,
const Iter &  e1,
const Iter &  b2,
const Iter &  e2,
const CMP &  cmp 
)
inline

Definition at line 23 of file combined_ordered_iterator.h.

24  :
25  m_b1(b1), m_e1(e1), m_b2(b2), m_e2(e2), m_cmp(cmp)
26  {
27  m_first = m_cmp( *m_b1, *m_b2);
28  }

◆ combined_ordered_iterator() [2/2]

template<class Iter , class CMP >
LArBadChanImpl::combined_ordered_iterator< Iter, CMP >::combined_ordered_iterator ( )
inline

Definition at line 30 of file combined_ordered_iterator.h.

30  : m_b1(Iter()), m_e1(Iter()),
31  m_b2(Iter()), m_e2(Iter()), m_cmp(CMP()),
32  m_first(false){}

Member Function Documentation

◆ advance()

template<class Iter , class CMP >
void LArBadChanImpl::combined_ordered_iterator< Iter, CMP >::advance ( )
inlineprivate

Definition at line 85 of file combined_ordered_iterator.h.

85  {
86  if (m_first) {
87  if (m_b1 != m_e1) ++m_b1;
88  }
89  else {
90  if (m_b2 != m_e2) ++m_b2;
91  }
92  }

◆ at_the_end()

template<class Iter , class CMP >
bool LArBadChanImpl::combined_ordered_iterator< Iter, CMP >::at_the_end ( ) const
inlineprivate

Definition at line 94 of file combined_ordered_iterator.h.

94  {
95  return m_first ? (m_b1 == m_e1) : (m_b2 == m_e2);
96  }

◆ current()

template<class Iter , class CMP >
const value_type& LArBadChanImpl::combined_ordered_iterator< Iter, CMP >::current ( ) const
inlineprivate

Definition at line 76 of file combined_ordered_iterator.h.

76 {return m_first ? *m_b1 : *m_b2;}

◆ current_iter()

template<class Iter , class CMP >
const Iter& LArBadChanImpl::combined_ordered_iterator< Iter, CMP >::current_iter ( ) const
inlineprivate

Definition at line 78 of file combined_ordered_iterator.h.

78 {return m_first ? m_b1 : m_b2;}

◆ next_in_same()

template<class Iter , class CMP >
const value_type& LArBadChanImpl::combined_ordered_iterator< Iter, CMP >::next_in_same ( ) const
inlineprivate

Definition at line 80 of file combined_ordered_iterator.h.

80  {
81  Iter tmp = (m_first? m_b1 : m_b2);
82  return *(++tmp);
83  }

◆ operator bool()

template<class Iter , class CMP >
LArBadChanImpl::combined_ordered_iterator< Iter, CMP >::operator bool ( ) const
inline

Definition at line 53 of file combined_ordered_iterator.h.

53 {return m_b1 != m_e1 || m_b2 != m_e2;}

◆ operator!=()

template<class Iter , class CMP >
bool LArBadChanImpl::combined_ordered_iterator< Iter, CMP >::operator!= ( const combined_ordered_iterator< Iter, CMP > &  other) const
inline

Definition at line 55 of file combined_ordered_iterator.h.

55  {
56  if (at_the_end()) return ! other.at_the_end();
57  else if (other.at_the_end()) return true;
58  else return current_iter() != other.current_iter();
59  }

◆ operator*()

template<class Iter , class CMP >
const value_type& LArBadChanImpl::combined_ordered_iterator< Iter, CMP >::operator* ( )
inline

Definition at line 49 of file combined_ordered_iterator.h.

49  {
50  return current();
51  }

◆ operator++() [1/2]

template<class Iter , class CMP >
combined_ordered_iterator& LArBadChanImpl::combined_ordered_iterator< Iter, CMP >::operator++ ( )
inline

Definition at line 34 of file combined_ordered_iterator.h.

34  {
35  advance();
36  if (at_the_end()) switch_to_other();
37  else if ( !other_at_the_end()) {
38  if (m_cmp(other(), current())) switch_to_other(); // we must switch to the other container
39  }
40  return *this;
41  }

◆ operator++() [2/2]

template<class Iter , class CMP >
combined_ordered_iterator LArBadChanImpl::combined_ordered_iterator< Iter, CMP >::operator++ ( int  )
inline

Definition at line 43 of file combined_ordered_iterator.h.

43  {
45  operator++();
46  return tmp;
47  }

◆ operator==()

template<class Iter , class CMP >
bool LArBadChanImpl::combined_ordered_iterator< Iter, CMP >::operator== ( const combined_ordered_iterator< Iter, CMP > &  other) const
inline

Definition at line 61 of file combined_ordered_iterator.h.

61  {
62  return !operator!=(other);
63  }

◆ other()

template<class Iter , class CMP >
const value_type& LArBadChanImpl::combined_ordered_iterator< Iter, CMP >::other ( ) const
inlineprivate

Definition at line 74 of file combined_ordered_iterator.h.

74 {return m_first ? *m_b2 : *m_b1;}

◆ other_at_the_end()

template<class Iter , class CMP >
bool LArBadChanImpl::combined_ordered_iterator< Iter, CMP >::other_at_the_end ( ) const
inlineprivate

Definition at line 98 of file combined_ordered_iterator.h.

98  {
99  return m_first ? (m_b2 == m_e2) : (m_b1 == m_e1);
100  }

◆ switch_to_other()

template<class Iter , class CMP >
void LArBadChanImpl::combined_ordered_iterator< Iter, CMP >::switch_to_other ( )
inlineprivate

Definition at line 102 of file combined_ordered_iterator.h.

102 { m_first = !m_first;}

Member Data Documentation

◆ m_b1

template<class Iter , class CMP >
Iter LArBadChanImpl::combined_ordered_iterator< Iter, CMP >::m_b1
private

Definition at line 67 of file combined_ordered_iterator.h.

◆ m_b2

template<class Iter , class CMP >
Iter LArBadChanImpl::combined_ordered_iterator< Iter, CMP >::m_b2
private

Definition at line 69 of file combined_ordered_iterator.h.

◆ m_cmp

template<class Iter , class CMP >
CMP LArBadChanImpl::combined_ordered_iterator< Iter, CMP >::m_cmp
private

Definition at line 71 of file combined_ordered_iterator.h.

◆ m_e1

template<class Iter , class CMP >
Iter LArBadChanImpl::combined_ordered_iterator< Iter, CMP >::m_e1
private

Definition at line 68 of file combined_ordered_iterator.h.

◆ m_e2

template<class Iter , class CMP >
Iter LArBadChanImpl::combined_ordered_iterator< Iter, CMP >::m_e2
private

Definition at line 70 of file combined_ordered_iterator.h.

◆ m_first

template<class Iter , class CMP >
bool LArBadChanImpl::combined_ordered_iterator< Iter, CMP >::m_first
private

Definition at line 72 of file combined_ordered_iterator.h.


The documentation for this class was generated from the following file:
python.EI_Lib.cmp
def cmp(x, y)
Definition: EI_Lib.py:6
egammaEnergyPositionAllSamples::e1
double e1(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 1st sampling
LArBadChanImpl::combined_ordered_iterator::m_b2
Iter m_b2
Definition: combined_ordered_iterator.h:69
LArBadChanImpl::combined_ordered_iterator::current_iter
const Iter & current_iter() const
Definition: combined_ordered_iterator.h:78
LArBadChanImpl::combined_ordered_iterator::operator!=
bool operator!=(const combined_ordered_iterator &other) const
Definition: combined_ordered_iterator.h:55
LArBadChanImpl::combined_ordered_iterator::m_e1
Iter m_e1
Definition: combined_ordered_iterator.h:68
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
LArBadChanImpl::combined_ordered_iterator::m_b1
Iter m_b1
Definition: combined_ordered_iterator.h:67
LArBadChanImpl::combined_ordered_iterator::operator++
combined_ordered_iterator & operator++()
Definition: combined_ordered_iterator.h:34
LArBadChanImpl::combined_ordered_iterator::at_the_end
bool at_the_end() const
Definition: combined_ordered_iterator.h:94
LArBadChanImpl::combined_ordered_iterator::current
const value_type & current() const
Definition: combined_ordered_iterator.h:76
LArBadChanImpl::combined_ordered_iterator::advance
void advance()
Definition: combined_ordered_iterator.h:85
LArBadChanImpl::combined_ordered_iterator::other
const value_type & other() const
Definition: combined_ordered_iterator.h:74
LArBadChanImpl::combined_ordered_iterator::m_cmp
CMP m_cmp
Definition: combined_ordered_iterator.h:71
LArBadChanImpl::combined_ordered_iterator::m_e2
Iter m_e2
Definition: combined_ordered_iterator.h:70
egammaEnergyPositionAllSamples::e2
double e2(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 2nd sampling
LArBadChanImpl::combined_ordered_iterator::m_first
bool m_first
Definition: combined_ordered_iterator.h:72
LArBadChanImpl::combined_ordered_iterator::other_at_the_end
bool other_at_the_end() const
Definition: combined_ordered_iterator.h:98
LArBadChanImpl::combined_ordered_iterator::switch_to_other
void switch_to_other()
Definition: combined_ordered_iterator.h:102
LArBadChanImpl::combined_ordered_iterator::combined_ordered_iterator
combined_ordered_iterator()
Definition: combined_ordered_iterator.h:30