ATLAS Offline Software
Loading...
Searching...
No Matches
DataModel_detail::const_iterator< DVL > Class Template Reference

Const iterator class for DataVector/DataList. More...

#include <DVLIterator.h>

Collaboration diagram for DataModel_detail::const_iterator< DVL >:

Public Types

typedef DVL::const_value_type value_type
 Standard iterator typedefs.
typedef value_type reference
typedef value_typepointer
typedef DVL::BaseContainer::const_iterator::difference_type difference_type
typedef DVL::BaseContainer::const_iterator::iterator_category iterator_category
typedef DVL Container
typedef DVL::BaseContainer BaseContainer

Public Member Functions

 const_iterator ()
 Default constructor.
 const_iterator (typename BaseContainer::const_iterator it)
 Constructor.
reference operator* () const
 Dereference. Operator-> doesn't make sense here.
reference operator[] (difference_type n) const
const_iteratoroperator++ ()
 Increment / decrement.
const_iterator operator++ (int)
const_iteratoroperator-- ()
const_iterator operator-- (int)
const_iteratoroperator+= (difference_type n)
 Arithmetic.
const_iteratoroperator-= (difference_type n)
const_iterator operator+ (difference_type n) const
const_iterator operator- (difference_type n) const
difference_type operator- (const_iterator other) const
bool operator== (const const_iterator &other) const
 Comparisons.
bool operator!= (const const_iterator &other) const
bool operator< (const const_iterator &other) const
bool operator> (const const_iterator &other) const
bool operator<= (const const_iterator &other) const
bool operator>= (const const_iterator &other) const

Private Member Functions

const DVL::value_type dereference () const
 Dereference the iterator.

Private Attributes

BaseContainer::const_iterator m_it
 The wrapped iterator.

Detailed Description

template<class DVL>
class DataModel_detail::const_iterator< DVL >

Const iterator class for DataVector/DataList.

We need to cast dereferences to the appropriate type. This could be done with a boost::transform_iterator, except that the iterator category for that will be one of boost's new-style iterator categories, which don't interoperate well with the standard C++ categories. In particular, the container concept checks didn't work.

This is templated on the specific DataVector/List class.

This used to be done using boost::iterator_adaptor, but that caused problems with root6. So now use just write out the iterator explicitly.

Definition at line 81 of file DVLIterator.h.

Member Typedef Documentation

◆ BaseContainer

template<class DVL>
typedef DVL::BaseContainer DataModel_detail::const_iterator< DVL >::BaseContainer

Definition at line 92 of file DVLIterator.h.

◆ Container

template<class DVL>
typedef DVL DataModel_detail::const_iterator< DVL >::Container

Definition at line 91 of file DVLIterator.h.

◆ difference_type

template<class DVL>
typedef DVL::BaseContainer::const_iterator::difference_type DataModel_detail::const_iterator< DVL >::difference_type

Definition at line 88 of file DVLIterator.h.

◆ iterator_category

template<class DVL>
typedef DVL::BaseContainer::const_iterator::iterator_category DataModel_detail::const_iterator< DVL >::iterator_category

Definition at line 89 of file DVLIterator.h.

◆ pointer

template<class DVL>
typedef value_type* DataModel_detail::const_iterator< DVL >::pointer

Definition at line 87 of file DVLIterator.h.

◆ reference

template<class DVL>
typedef value_type DataModel_detail::const_iterator< DVL >::reference

Definition at line 86 of file DVLIterator.h.

◆ value_type

template<class DVL>
typedef DVL::const_value_type DataModel_detail::const_iterator< DVL >::value_type

Standard iterator typedefs.

Definition at line 85 of file DVLIterator.h.

Constructor & Destructor Documentation

◆ const_iterator() [1/2]

template<class DVL>
DataModel_detail::const_iterator< DVL >::const_iterator ( )
inline

Default constructor.

Definition at line 98 of file DVLIterator.h.

98{}

◆ const_iterator() [2/2]

template<class DVL>
DataModel_detail::const_iterator< DVL >::const_iterator ( typename BaseContainer::const_iterator< DVL > it)
inline

Constructor.

Parameters
itThe underlying container iterator.

Definition at line 105 of file DVLIterator.h.

106 : m_it (it)
107 {}
Const iterator class for DataVector/DataList.
Definition DVLIterator.h:82
BaseContainer::const_iterator m_it
The wrapped iterator.

Member Function Documentation

◆ dereference()

template<class DVL>
const DVL::value_type DataModel_detail::const_iterator< DVL >::dereference ( ) const
inlineprivate

Dereference the iterator.

Returns
The pointed-to element.

Definition at line 150 of file DVLIterator.h.

151 {
153 }

◆ operator!=()

template<class DVL>
bool DataModel_detail::const_iterator< DVL >::operator!= ( const const_iterator< DVL > & other) const
inline

Definition at line 135 of file DVLIterator.h.

135{ return m_it != other.m_it; }

◆ operator*()

template<class DVL>
reference DataModel_detail::const_iterator< DVL >::operator* ( ) const
inline

Dereference. Operator-> doesn't make sense here.

Definition at line 111 of file DVLIterator.h.

111{ return dereference(); }
const DVL::value_type dereference() const
Dereference the iterator.

◆ operator+()

template<class DVL>
const_iterator DataModel_detail::const_iterator< DVL >::operator+ ( difference_type n) const
inline

Definition at line 128 of file DVLIterator.h.

128{ const_iterator tmp = *this; tmp += n; return tmp; }
const_iterator()
Default constructor.
Definition DVLIterator.h:98

◆ operator++() [1/2]

template<class DVL>
const_iterator & DataModel_detail::const_iterator< DVL >::operator++ ( )
inline

Increment / decrement.

Definition at line 117 of file DVLIterator.h.

117{ ++m_it; return *this; }

◆ operator++() [2/2]

template<class DVL>
const_iterator DataModel_detail::const_iterator< DVL >::operator++ ( int )
inline

Definition at line 118 of file DVLIterator.h.

119 { const_iterator tmp = *this; ++m_it; return tmp; }

◆ operator+=()

template<class DVL>
const_iterator & DataModel_detail::const_iterator< DVL >::operator+= ( difference_type n)
inline

Arithmetic.

Definition at line 126 of file DVLIterator.h.

126{ m_it += n; return *this; }

◆ operator-() [1/2]

template<class DVL>
difference_type DataModel_detail::const_iterator< DVL >::operator- ( const_iterator< DVL > other) const
inline

Definition at line 130 of file DVLIterator.h.

130{ return m_it - other.m_it; }

◆ operator-() [2/2]

template<class DVL>
const_iterator DataModel_detail::const_iterator< DVL >::operator- ( difference_type n) const
inline

Definition at line 129 of file DVLIterator.h.

129{ const_iterator tmp = *this; tmp -= n; return tmp; }

◆ operator--() [1/2]

template<class DVL>
const_iterator & DataModel_detail::const_iterator< DVL >::operator-- ( )
inline

Definition at line 120 of file DVLIterator.h.

120{ --m_it; return *this; }

◆ operator--() [2/2]

template<class DVL>
const_iterator DataModel_detail::const_iterator< DVL >::operator-- ( int )
inline

Definition at line 121 of file DVLIterator.h.

122 { const_iterator tmp = *this; --m_it; return tmp; }

◆ operator-=()

template<class DVL>
const_iterator & DataModel_detail::const_iterator< DVL >::operator-= ( difference_type n)
inline

Definition at line 127 of file DVLIterator.h.

127{ m_it -= n; return *this; }

◆ operator<()

template<class DVL>
bool DataModel_detail::const_iterator< DVL >::operator< ( const const_iterator< DVL > & other) const
inline

Definition at line 136 of file DVLIterator.h.

136{ return m_it < other.m_it; }

◆ operator<=()

template<class DVL>
bool DataModel_detail::const_iterator< DVL >::operator<= ( const const_iterator< DVL > & other) const
inline

Definition at line 138 of file DVLIterator.h.

138{ return m_it <= other.m_it; }

◆ operator==()

template<class DVL>
bool DataModel_detail::const_iterator< DVL >::operator== ( const const_iterator< DVL > & other) const
inline

Comparisons.

Definition at line 134 of file DVLIterator.h.

134{ return m_it == other.m_it; }

◆ operator>()

template<class DVL>
bool DataModel_detail::const_iterator< DVL >::operator> ( const const_iterator< DVL > & other) const
inline

Definition at line 137 of file DVLIterator.h.

137{ return m_it > other.m_it; }

◆ operator>=()

template<class DVL>
bool DataModel_detail::const_iterator< DVL >::operator>= ( const const_iterator< DVL > & other) const
inline

Definition at line 139 of file DVLIterator.h.

139{ return m_it >= other.m_it; }

◆ operator[]()

template<class DVL>
reference DataModel_detail::const_iterator< DVL >::operator[] ( difference_type n) const
inline

Definition at line 112 of file DVLIterator.h.

113 { const_iterator tmp = *this + n; return *tmp; }

Member Data Documentation

◆ m_it

template<class DVL>
BaseContainer::const_iterator DataModel_detail::const_iterator< DVL >::m_it
private

The wrapped iterator.

Definition at line 144 of file DVLIterator.h.


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