CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
edm::reftobase::BaseVectorHolder< T >::const_iterator Struct Reference

#include <BaseVectorHolder.h>

Inheritance diagram for edm::reftobase::BaseVectorHolder< T >::const_iterator:

Public Types

typedef std::ptrdiff_t difference_type
 
typedef std::unique_ptr< value_typepointer
 
typedef base_ref_type value_type
 

Public Member Functions

 const_iterator ()
 
 const_iterator (const_iterator_imp *it)
 
 const_iterator (const_iterator const &it)
 
bool isInvalid () const
 
bool isValid () const
 
bool operator!= (const_iterator const &ci) const
 
value_type operator* () const
 
const_iterator operator+ (difference_type n) const
 
const_iteratoroperator++ ()
 
const_iterator operator++ (int)
 
const_iteratoroperator+= (difference_type d)
 
difference_type operator- (const_iterator const &o) const
 
const_iterator operator- (difference_type n) const
 
const_iteratoroperator-- ()
 
const_iterator operator-- (int)
 
const_iteratoroperator-= (difference_type d)
 
pointer operator-> () const
 
bool operator< (const_iterator const &o) const
 
const_iteratoroperator= (const_iterator const &it)
 
bool operator== (const_iterator const &ci) const
 
void throwInvalidReference (bool iIsInvalid, char const *iWhy) const
 
 ~const_iterator ()
 

Private Attributes

const_iterator_impi
 

Detailed Description

template<typename T>
struct edm::reftobase::BaseVectorHolder< T >::const_iterator

Definition at line 53 of file BaseVectorHolder.h.

Member Typedef Documentation

template<typename T>
typedef std::ptrdiff_t edm::reftobase::BaseVectorHolder< T >::const_iterator::difference_type

Definition at line 56 of file BaseVectorHolder.h.

template<typename T>
typedef std::unique_ptr<value_type> edm::reftobase::BaseVectorHolder< T >::const_iterator::pointer

Definition at line 55 of file BaseVectorHolder.h.

Definition at line 54 of file BaseVectorHolder.h.

Constructor & Destructor Documentation

template<typename T>
edm::reftobase::BaseVectorHolder< T >::const_iterator::const_iterator ( )
inline

Definition at line 58 of file BaseVectorHolder.h.

58 : i(nullptr) { }
template<typename T>
edm::reftobase::BaseVectorHolder< T >::const_iterator::const_iterator ( const_iterator_imp it)
inline

Definition at line 59 of file BaseVectorHolder.h.

59 : i(it) { }
template<typename T>
edm::reftobase::BaseVectorHolder< T >::const_iterator::const_iterator ( const_iterator const &  it)
inline

Definition at line 60 of file BaseVectorHolder.h.

60 : i(it.isValid() ? it.i->clone() : nullptr) { }
template<typename T>
edm::reftobase::BaseVectorHolder< T >::const_iterator::~const_iterator ( )
inline

Definition at line 61 of file BaseVectorHolder.h.

References mps_fire::i.

61 { delete i; }

Member Function Documentation

template<typename T>
bool edm::reftobase::BaseVectorHolder< T >::const_iterator::isInvalid ( ) const
inline
template<typename T>
bool edm::reftobase::BaseVectorHolder< T >::const_iterator::isValid ( void  ) const
inline

Definition at line 141 of file BaseVectorHolder.h.

References mps_fire::i.

Referenced by ntupleDataFormat._Object::_checkIsValid(), and core.AutoHandle.AutoHandle::ReallyLoad().

141 { return i != nullptr; }
template<typename T>
bool edm::reftobase::BaseVectorHolder< T >::const_iterator::operator!= ( const_iterator const &  ci) const
inline

Definition at line 119 of file BaseVectorHolder.h.

References edm::reftobase::BaseVectorHolder< T >::const_iterator::i, mps_fire::i, and edm::reftobase::BaseVectorHolder< T >::const_iterator::isInvalid().

119  {
120  if (isInvalid() && ci.isInvalid()) return false;
121  if (isInvalid() || ci.isInvalid()) return true;
122  return ! i->equal_to(ci.i);
123  }
virtual bool equal_to(const_iterator_imp const *) const =0
template<typename T>
value_type edm::reftobase::BaseVectorHolder< T >::const_iterator::operator* ( ) const
inline

Definition at line 124 of file BaseVectorHolder.h.

References mps_fire::i.

124  {
125  throwInvalidReference(isInvalid(), "dereference");
126  return i->deref();
127  }
void throwInvalidReference(bool iIsInvalid, char const *iWhy) const
template<typename T>
const_iterator edm::reftobase::BaseVectorHolder< T >::const_iterator::operator+ ( difference_type  n) const
inline

Definition at line 97 of file BaseVectorHolder.h.

References mps_fire::i, cuy::ii, and edm::reftobase::BaseVectorHolder< T >::const_iterator_imp::increase().

97  {
98  throwInvalidReference(isInvalid(), "compute sum with");
99  const_iterator_imp* ii = i->clone();
100  ii->increase(n);
101  return const_iterator(ii);
102  }
ii
Definition: cuy.py:590
void throwInvalidReference(bool iIsInvalid, char const *iWhy) const
virtual const_iterator_imp * clone() const =0
template<typename T>
const_iterator& edm::reftobase::BaseVectorHolder< T >::const_iterator::operator++ ( )
inline

Definition at line 70 of file BaseVectorHolder.h.

References mps_fire::i.

70  {
71  throwInvalidReference(isInvalid(), "increment");
72  i->increase();
73  return *this;
74  }
void throwInvalidReference(bool iIsInvalid, char const *iWhy) const
template<typename T>
const_iterator edm::reftobase::BaseVectorHolder< T >::const_iterator::operator++ ( int  )
inline

Definition at line 75 of file BaseVectorHolder.h.

References mps_fire::i.

template<typename T>
const_iterator& edm::reftobase::BaseVectorHolder< T >::const_iterator::operator+= ( difference_type  d)
inline

Definition at line 131 of file BaseVectorHolder.h.

References mps_fire::i.

131  {
132  throwInvalidReference(isInvalid(), "increment");
133  i->increase(d);
134  return *this;
135  }
void throwInvalidReference(bool iIsInvalid, char const *iWhy) const
template<typename T>
difference_type edm::reftobase::BaseVectorHolder< T >::const_iterator::operator- ( const_iterator const &  o) const
inline

Definition at line 92 of file BaseVectorHolder.h.

References edm::reftobase::BaseVectorHolder< T >::const_iterator::i, mps_fire::i, and edm::reftobase::BaseVectorHolder< T >::const_iterator::isInvalid().

92  {
93  if (isInvalid() && o.isInvalid()) return 0;
94  throwInvalidReference(isInvalid() || o.isInvalid(), "compute difference with");
95  return i->difference(o.i);
96  }
virtual difference_type difference(const_iterator_imp const *) const =0
void throwInvalidReference(bool iIsInvalid, char const *iWhy) const
template<typename T>
const_iterator edm::reftobase::BaseVectorHolder< T >::const_iterator::operator- ( difference_type  n) const
inline

Definition at line 103 of file BaseVectorHolder.h.

References edm::reftobase::BaseVectorHolder< T >::const_iterator_imp::decrease(), mps_fire::i, and cuy::ii.

103  {
104  throwInvalidReference(isInvalid(), "compute difference with");
105  const_iterator_imp* ii = i->clone();
106  ii->decrease(n);
107  return const_iterator(ii);
108  }
ii
Definition: cuy.py:590
void throwInvalidReference(bool iIsInvalid, char const *iWhy) const
virtual const_iterator_imp * clone() const =0
template<typename T>
const_iterator& edm::reftobase::BaseVectorHolder< T >::const_iterator::operator-- ( )
inline

Definition at line 81 of file BaseVectorHolder.h.

References mps_fire::i.

81  {
82  throwInvalidReference(isInvalid(), "decrement");
83  i->decrease();
84  return *this;
85  }
void throwInvalidReference(bool iIsInvalid, char const *iWhy) const
template<typename T>
const_iterator edm::reftobase::BaseVectorHolder< T >::const_iterator::operator-- ( int  )
inline

Definition at line 86 of file BaseVectorHolder.h.

References mps_fire::i.

template<typename T>
const_iterator& edm::reftobase::BaseVectorHolder< T >::const_iterator::operator-= ( difference_type  d)
inline

Definition at line 136 of file BaseVectorHolder.h.

References mps_fire::i.

136  {
137  throwInvalidReference(isInvalid(), "decrement");
138  i->decrease(d);
139  return *this;
140  }
void throwInvalidReference(bool iIsInvalid, char const *iWhy) const
template<typename T>
pointer edm::reftobase::BaseVectorHolder< T >::const_iterator::operator-> ( ) const
inline

Definition at line 128 of file BaseVectorHolder.h.

128  {
129  return pointer(new value_type(operator*()));
130  }
template<typename T>
bool edm::reftobase::BaseVectorHolder< T >::const_iterator::operator< ( const_iterator const &  o) const
inline

Definition at line 109 of file BaseVectorHolder.h.

References edm::reftobase::BaseVectorHolder< T >::const_iterator::i, mps_fire::i, and edm::reftobase::BaseVectorHolder< T >::const_iterator::isInvalid().

109  {
110  if (isInvalid() && o.isInvalid()) return false;
111  throwInvalidReference(isInvalid() || o.isInvalid(), "compute < operator with");
112  return i->less_than(o.i);
113  }
virtual bool less_than(const_iterator_imp const *) const =0
void throwInvalidReference(bool iIsInvalid, char const *iWhy) const
template<typename T>
const_iterator& edm::reftobase::BaseVectorHolder< T >::const_iterator::operator= ( const_iterator const &  it)
inline

Definition at line 62 of file BaseVectorHolder.h.

References edm::reftobase::BaseVectorHolder< T >::const_iterator::i, and mps_fire::i.

62  {
63  if(this == &it) {
64  return *this;
65  }
66  if (isInvalid()) i = it.i;
67  else i->assign(it.i);
68  return *this;
69  }
virtual void assign(const_iterator_imp const *)=0
template<typename T>
bool edm::reftobase::BaseVectorHolder< T >::const_iterator::operator== ( const_iterator const &  ci) const
inline

Definition at line 114 of file BaseVectorHolder.h.

References edm::reftobase::BaseVectorHolder< T >::const_iterator::i, mps_fire::i, and edm::reftobase::BaseVectorHolder< T >::const_iterator::isInvalid().

114  {
115  if (isInvalid() && ci.isInvalid()) return true;
116  if (isInvalid() || ci.isInvalid()) return false;
117  return i->equal_to(ci.i);
118  }
virtual bool equal_to(const_iterator_imp const *) const =0
template<typename T>
void edm::reftobase::BaseVectorHolder< T >::const_iterator::throwInvalidReference ( bool  iIsInvalid,
char const *  iWhy 
) const
inline

Definition at line 144 of file BaseVectorHolder.h.

References edm::errors::InvalidReference, and edm::Exception::throwThis().

144  {
145  if (iIsInvalid) {
146  Exception::throwThis(errors::InvalidReference, "Trying to ", iWhy, " an invalid RefToBaseVector<T>::const_iterator");
147  }
148  }
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
Definition: EDMException.cc:83

Member Data Documentation

template<typename T>
const_iterator_imp* edm::reftobase::BaseVectorHolder< T >::const_iterator::i
private