ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
CaloCluster::MomentStoreIter Class Reference

Internal cell iterator. More...

#include <CaloCluster.h>

Collaboration diagram for CaloCluster::MomentStoreIter:

Public Member Functions

 MomentStoreIter ()
 Default constructor builds unusable iterator. More...
 
 MomentStoreIter (const moment_iterator_i &iter, const moment_store *firstStore, const moment_store *secndStore=0)
 Standard constructor for a useable iterator. More...
 
 ~MomentStoreIter ()
 Destructor. More...
 
MomentStoreIter next ()
 Advance iterator. More...
 
MomentStoreIter prev ()
 Step back iterator. More...
 
MomentStoreIter operator++ ()
 Post-advance operator. More...
 
MomentStoreIter operator++ (int)
 Pre-advance operator. More...
 
MomentStoreIter operator-- ()
 Post-step back operator. More...
 
MomentStoreIter operator-- (int)
 Pre-step back operator. More...
 
bool operator== (const MomentStoreIter &anOther) const
 Equality comparator. More...
 
bool operator!= (const MomentStoreIter &anOther) const
 Inequality comparator. More...
 
const CaloClusterMomentoperator* () const
 Operator access to CaloClusterMoment. More...
 
const CaloClusterMomentgetMoment () const
 Function access to CaloClusterMoment. More...
 
moment_type getMomentType () const
 Function access to moment type. More...
 

Private Attributes

moment_iterator_i m_iter
 Actual iterator on CaloClusterMomentStore. More...
 
const moment_storem_firstStore
 Pointer to first CaloClusterMomentStore. More...
 
const moment_storem_secndStore
 Pointer to second CaloClusterMomentStore. More...
 

Detailed Description

Internal cell iterator.

Principle iterator of the (split) moment store. Only for read access presently. Automatically loops cached and external moment store, the latter only if available. The iterator range is as follows:

Definition at line 154 of file Calorimeter/CaloEvent/CaloEvent/CaloCluster.h.

Constructor & Destructor Documentation

◆ MomentStoreIter() [1/2]

CaloCluster::MomentStoreIter::MomentStoreIter ( )

Default constructor builds unusable iterator.

Definition at line 1518 of file CaloCluster.cxx.

1518 : m_iter(), m_firstStore(nullptr), m_secndStore(nullptr) { }

◆ MomentStoreIter() [2/2]

CaloCluster::MomentStoreIter::MomentStoreIter ( const moment_iterator_i iter,
const moment_store firstStore,
const moment_store secndStore = 0 
)

Standard constructor for a useable iterator.

Definition at line 1520 of file CaloCluster.cxx.

1523  : m_iter(iter), m_firstStore(firstStore), m_secndStore(secndStore)
1524 { }

◆ ~MomentStoreIter()

CaloCluster::MomentStoreIter::~MomentStoreIter ( )
default

Destructor.

Member Function Documentation

◆ getMoment()

const CaloClusterMoment & CaloCluster::MomentStoreIter::getMoment ( ) const

Function access to CaloClusterMoment.

Definition at line 1570 of file CaloCluster.cxx.

1570 { return *m_iter; }

◆ getMomentType()

CaloCluster::moment_type CaloCluster::MomentStoreIter::getMomentType ( ) const

Function access to moment type.

Definition at line 1572 of file CaloCluster.cxx.

1572 { return m_iter.getMomentType(); }

◆ next()

CaloCluster::MomentStoreIter CaloCluster::MomentStoreIter::next ( )

Advance iterator.

Definition at line 1529 of file CaloCluster.cxx.

1530 {
1531  m_iter++;
1532  if ( m_iter == m_firstStore->end() &&
1533  ( m_secndStore != nullptr && m_secndStore->size() > 0 ) )
1534  {
1535  m_iter = m_secndStore->begin();
1536  }
1537  return *this;
1538 }

◆ operator!=()

Inequality comparator.

Definition at line 1564 of file CaloCluster.cxx.

1565 { return m_iter != anOther.m_iter; }

◆ operator*()

const CaloClusterMoment & CaloCluster::MomentStoreIter::operator* ( ) const

Operator access to CaloClusterMoment.

Definition at line 1568 of file CaloCluster.cxx.

1568 { return *m_iter; }

◆ operator++() [1/2]

CaloCluster::MomentStoreIter CaloCluster::MomentStoreIter::operator++ ( )

Post-advance operator.

Definition at line 1552 of file CaloCluster.cxx.

1552 { return this->next(); }

◆ operator++() [2/2]

CaloCluster::MomentStoreIter CaloCluster::MomentStoreIter::operator++ ( int  )

Pre-advance operator.

Definition at line 1554 of file CaloCluster.cxx.

1554 { return this->next(); }

◆ operator--() [1/2]

CaloCluster::MomentStoreIter CaloCluster::MomentStoreIter::operator-- ( )

Post-step back operator.

Definition at line 1556 of file CaloCluster.cxx.

1556 { return this->prev(); }

◆ operator--() [2/2]

CaloCluster::MomentStoreIter CaloCluster::MomentStoreIter::operator-- ( int  )

Pre-step back operator.

Definition at line 1558 of file CaloCluster.cxx.

1558 { return this->prev(); }

◆ operator==()

bool CaloCluster::MomentStoreIter::operator== ( const MomentStoreIter anOther) const

Equality comparator.

Definition at line 1561 of file CaloCluster.cxx.

1562 { return m_iter == anOther.m_iter; }

◆ prev()

CaloCluster::MomentStoreIter CaloCluster::MomentStoreIter::prev ( )

Step back iterator.

Definition at line 1541 of file CaloCluster.cxx.

1542 {
1543  if ( m_secndStore != nullptr && m_iter == m_secndStore->begin() )
1544  {
1545  m_iter = m_firstStore->end();
1546  }
1547  m_iter--;
1548  return *this;
1549 }

Member Data Documentation

◆ m_firstStore

const moment_store* CaloCluster::MomentStoreIter::m_firstStore
private

Pointer to first CaloClusterMomentStore.

Definition at line 199 of file Calorimeter/CaloEvent/CaloEvent/CaloCluster.h.

◆ m_iter

moment_iterator_i CaloCluster::MomentStoreIter::m_iter
private

Actual iterator on CaloClusterMomentStore.

Definition at line 197 of file Calorimeter/CaloEvent/CaloEvent/CaloCluster.h.

◆ m_secndStore

const moment_store* CaloCluster::MomentStoreIter::m_secndStore
private

Pointer to second CaloClusterMomentStore.

Definition at line 201 of file Calorimeter/CaloEvent/CaloEvent/CaloCluster.h.


The documentation for this class was generated from the following files:
CaloClusterMomentStore::begin
virtual moment_iterator begin() const
{
Definition: CaloClusterMomentStore.h:220
CaloCluster::MomentStoreIter::next
MomentStoreIter next()
Advance iterator.
Definition: CaloCluster.cxx:1529
CaloCluster::MomentStoreIter::m_firstStore
const moment_store * m_firstStore
Pointer to first CaloClusterMomentStore.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:199
CaloCluster::MomentStoreIter::m_secndStore
const moment_store * m_secndStore
Pointer to second CaloClusterMomentStore.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:201
CaloCluster::MomentStoreIter::m_iter
moment_iterator_i m_iter
Actual iterator on CaloClusterMomentStore.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:197
CaloClusterMomentStore::end
virtual moment_iterator end() const
iterator loop terminator
Definition: CaloClusterMomentStore.h:226
CaloCluster::MomentStoreIter::prev
MomentStoreIter prev()
Step back iterator.
Definition: CaloCluster.cxx:1541
CaloClusterMomentStore::size
size_t size() const
Number of stored moments.
Definition: CaloClusterMomentStore.h:242