CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
CaloRecHitMetaCollectionV::Iterator Class Reference

#include <CaloRecHitMetaCollectionV.h>

Public Types

typedef int difference_type
 
typedef
std::random_access_iterator_tag 
iterator_category
 
typedef int offset_type
 
typedef const CaloRecHitpointer
 
typedef const CaloRecHitreference
 
typedef const CaloRecHitvalue_type
 

Public Member Functions

 Iterator ()
 
 Iterator (const Iterator &it)
 
 Iterator (const CaloRecHitMetaCollectionV *col, offset_type pos)
 
bool operator!= (const Iterator &it) const
 comparison operator More...
 
reference operator* () const
 dereference operator More...
 
Iterator operator+ (const difference_type n) const
 
Iteratoroperator++ ()
 Advance the iterator. More...
 
Iterator operator++ (int)
 Advance the iterator. More...
 
Iteratoroperator+= (const difference_type n)
 
Iterator operator- (const difference_type n) const
 
Iteratoroperator-- ()
 Reverse-advance the iterator. More...
 
Iterator operator-- (int)
 Reverse-advance the iterator. More...
 
Iteratoroperator-= (const difference_type n)
 
pointer operator-> () const
 pointer operator More...
 
bool operator< (const Iterator &i) const
 
Iteratoroperator= (const Iterator &it)
 
bool operator== (const Iterator &it) const
 comparison operator More...
 
reference operator[] (const difference_type n) const
 

Private Attributes

const CaloRecHitMetaCollectionVcollection_
 
offset_type offset_
 

Detailed Description

Definition at line 18 of file CaloRecHitMetaCollectionV.h.

Member Typedef Documentation

Definition at line 22 of file CaloRecHitMetaCollectionV.h.

typedef std::random_access_iterator_tag CaloRecHitMetaCollectionV::Iterator::iterator_category

Definition at line 20 of file CaloRecHitMetaCollectionV.h.

Definition at line 25 of file CaloRecHitMetaCollectionV.h.

Definition at line 24 of file CaloRecHitMetaCollectionV.h.

Definition at line 23 of file CaloRecHitMetaCollectionV.h.

Definition at line 21 of file CaloRecHitMetaCollectionV.h.

Constructor & Destructor Documentation

CaloRecHitMetaCollectionV::Iterator::Iterator ( )
inline

Definition at line 27 of file CaloRecHitMetaCollectionV.h.

CaloRecHitMetaCollectionV::Iterator::Iterator ( const Iterator it)
inline

Definition at line 28 of file CaloRecHitMetaCollectionV.h.

28 : collection_(it.collection_), offset_(it.offset_) { }
const CaloRecHitMetaCollectionV * collection_
CaloRecHitMetaCollectionV::Iterator::Iterator ( const CaloRecHitMetaCollectionV col,
offset_type  pos 
)
inline

Definition at line 29 of file CaloRecHitMetaCollectionV.h.

29 : collection_(col), offset_(pos) { }
const CaloRecHitMetaCollectionV * collection_

Member Function Documentation

bool CaloRecHitMetaCollectionV::Iterator::operator!= ( const Iterator it) const

comparison operator

Definition at line 26 of file CaloRecHitMetaCollectionV.cc.

References collection_, and offset_.

26  {
27  return collection_!=it.collection_ || offset_!=it.offset_;
28 }
const CaloRecHitMetaCollectionV * collection_
const CaloRecHit & CaloRecHitMetaCollectionV::const_iterator::operator* ( void  ) const

dereference operator

Definition at line 13 of file CaloRecHitMetaCollectionV.cc.

References CaloRecHitMetaCollectionV::at(), collection_, and offset_.

13  {
14  return (*collection_->at(offset_));
15 }
virtual const CaloRecHit * at(const_iterator::offset_type i) const =0
get an item by index
const CaloRecHitMetaCollectionV * collection_
CaloRecHitMetaCollectionV::Iterator CaloRecHitMetaCollectionV::Iterator::operator+ ( const difference_type  n) const
CaloRecHitMetaCollectionV::Iterator & CaloRecHitMetaCollectionV::Iterator::operator++ ( void  )

Advance the iterator.

Definition at line 30 of file CaloRecHitMetaCollectionV.cc.

30  {
31  offset_++;
32  return (*this);
33 }
CaloRecHitMetaCollectionV::Iterator CaloRecHitMetaCollectionV::Iterator::operator++ ( int  )

Advance the iterator.

Definition at line 35 of file CaloRecHitMetaCollectionV.cc.

References tmp.

35  {
36  Iterator tmp(*this);
37  offset_++;
38  return tmp;
39 }
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
CaloRecHitMetaCollectionV::Iterator & CaloRecHitMetaCollectionV::Iterator::operator+= ( const difference_type  n)

Definition at line 57 of file CaloRecHitMetaCollectionV.cc.

References n.

57  {
58  offset_+=n;
59  return (*this);
60 }
CaloRecHitMetaCollectionV::Iterator CaloRecHitMetaCollectionV::Iterator::operator- ( const difference_type  n) const
CaloRecHitMetaCollectionV::Iterator & CaloRecHitMetaCollectionV::Iterator::operator-- ( )

Reverse-advance the iterator.

Definition at line 41 of file CaloRecHitMetaCollectionV.cc.

41  {
42  offset_--;
43  return (*this);
44 }
CaloRecHitMetaCollectionV::Iterator CaloRecHitMetaCollectionV::Iterator::operator-- ( int  )

Reverse-advance the iterator.

Definition at line 47 of file CaloRecHitMetaCollectionV.cc.

References tmp.

47  {
48  Iterator tmp(*this);
49  offset_--;
50  return tmp;
51 }
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
CaloRecHitMetaCollectionV::Iterator & CaloRecHitMetaCollectionV::Iterator::operator-= ( const difference_type  n)

Definition at line 66 of file CaloRecHitMetaCollectionV.cc.

References n.

66  {
67  offset_-=n;
68  return (*this);
69 }
const CaloRecHit * CaloRecHitMetaCollectionV::const_iterator::operator-> ( ) const

pointer operator

Definition at line 17 of file CaloRecHitMetaCollectionV.cc.

17  {
18  return (collection_==0)?(0):(collection_->at(offset_));
19 }
virtual const CaloRecHit * at(const_iterator::offset_type i) const =0
get an item by index
const CaloRecHitMetaCollectionV * collection_
bool CaloRecHitMetaCollectionV::Iterator::operator< ( const Iterator i) const

Definition at line 75 of file CaloRecHitMetaCollectionV.cc.

References offset_.

75  {
76  return offset_<i.offset_;
77 }
Iterator& CaloRecHitMetaCollectionV::Iterator::operator= ( const Iterator it)
inline

Definition at line 30 of file CaloRecHitMetaCollectionV.h.

References collection_, and offset_.

30 { collection_=it.collection_; offset_=it.offset_; return (*this); }
const CaloRecHitMetaCollectionV * collection_
bool CaloRecHitMetaCollectionV::Iterator::operator== ( const Iterator it) const

comparison operator

Definition at line 22 of file CaloRecHitMetaCollectionV.cc.

References collection_, and offset_.

22  {
23  return collection_==it.collection_ && offset_==it.offset_;
24 }
const CaloRecHitMetaCollectionV * collection_
CaloRecHitMetaCollectionV::Iterator::reference CaloRecHitMetaCollectionV::Iterator::operator[] ( const difference_type  n) const

Definition at line 53 of file CaloRecHitMetaCollectionV.cc.

53  {
54  return *(collection_->at(offset_+n));
55 }
virtual const CaloRecHit * at(const_iterator::offset_type i) const =0
get an item by index
const CaloRecHitMetaCollectionV * collection_

Member Data Documentation

const CaloRecHitMetaCollectionV* CaloRecHitMetaCollectionV::Iterator::collection_
private

Definition at line 60 of file CaloRecHitMetaCollectionV.h.

Referenced by operator!=(), operator*(), operator=(), and operator==().

offset_type CaloRecHitMetaCollectionV::Iterator::offset_
private

Definition at line 61 of file CaloRecHitMetaCollectionV.h.

Referenced by operator!=(), operator*(), operator<(), operator=(), and operator==().