LLVM 22.0.0git
llvm::indexed_accessor_iterator< DerivedT, BaseT, T, PointerT, ReferenceT > Class Template Reference

A utility class used to implement an iterator that contains some base object and an index. More...

#include "llvm/ADT/STLExtras.h"

Inheritance diagram for llvm::indexed_accessor_iterator< DerivedT, BaseT, T, PointerT, ReferenceT >:
[legend]

Public Member Functions

ptrdiff_t operator- (const indexed_accessor_iterator &rhs) const
bool operator== (const indexed_accessor_iterator &rhs) const
bool operator< (const indexed_accessor_iterator &rhs) const
DerivedT & operator+= (ptrdiff_t offset)
DerivedT & operator-= (ptrdiff_t offset)
ptrdiff_t getIndex () const
 Returns the current index of the iterator.
const BaseT & getBase () const
 Returns the current base of the iterator.
Public Member Functions inherited from llvm::iterator_facade_base< DerivedT, std::random_access_iterator_tag, T, std::ptrdiff_t, T *, T & >
DerivedT operator+ (std::ptrdiff_t n) const
DerivedT operator- (std::ptrdiff_t n) const
DerivedT & operator++ ()
DerivedT & operator-- ()
bool operator!= (const DerivedT &RHS) const
bool operator> (const DerivedT &RHS) const
bool operator<= (const DerivedT &RHS) const
bool operator>= (const DerivedT &RHS) const
PointerProxy operator-> () const
ReferenceProxy operator[] (std::ptrdiff_t n) const

Protected Member Functions

 indexed_accessor_iterator (BaseT base, ptrdiff_t index)

Protected Attributes

BaseT base
ptrdiff_t index

Additional Inherited Members

Public Types inherited from llvm::iterator_facade_base< DerivedT, std::random_access_iterator_tag, T, std::ptrdiff_t, T *, T & >
using iterator_category
using value_type
using difference_type
using pointer
using reference
Protected Types inherited from llvm::iterator_facade_base< DerivedT, std::random_access_iterator_tag, T, std::ptrdiff_t, T *, T & >
enum  

Detailed Description

template<typename DerivedT, typename BaseT, typename T, typename PointerT = T *, typename ReferenceT = T &>
class llvm::indexed_accessor_iterator< DerivedT, BaseT, T, PointerT, ReferenceT >

A utility class used to implement an iterator that contains some base object and an index.

The iterator moves the index but keeps the base constant.

Definition at line 1171 of file STLExtras.h.

Constructor & Destructor Documentation

◆ indexed_accessor_iterator()

template<typename DerivedT, typename BaseT, typename T, typename PointerT = T *, typename ReferenceT = T &>
llvm::indexed_accessor_iterator< DerivedT, BaseT, T, PointerT, ReferenceT >::indexed_accessor_iterator ( BaseT base,
ptrdiff_t index )
inlineprotected

Definition at line 1205 of file STLExtras.h.

References base, and index.

Referenced by operator-(), operator<(), and operator==().

Member Function Documentation

◆ getBase()

template<typename DerivedT, typename BaseT, typename T, typename PointerT = T *, typename ReferenceT = T &>
const BaseT & llvm::indexed_accessor_iterator< DerivedT, BaseT, T, PointerT, ReferenceT >::getBase ( ) const
inline

Returns the current base of the iterator.

Definition at line 1202 of file STLExtras.h.

References base.

◆ getIndex()

template<typename DerivedT, typename BaseT, typename T, typename PointerT = T *, typename ReferenceT = T &>
ptrdiff_t llvm::indexed_accessor_iterator< DerivedT, BaseT, T, PointerT, ReferenceT >::getIndex ( ) const
inline

Returns the current index of the iterator.

Definition at line 1199 of file STLExtras.h.

References index.

◆ operator+=()

template<typename DerivedT, typename BaseT, typename T, typename PointerT = T *, typename ReferenceT = T &>
DerivedT & llvm::indexed_accessor_iterator< DerivedT, BaseT, T, PointerT, ReferenceT >::operator+= ( ptrdiff_t offset)
inline

Definition at line 1189 of file STLExtras.h.

References index.

◆ operator-()

template<typename DerivedT, typename BaseT, typename T, typename PointerT = T *, typename ReferenceT = T &>
ptrdiff_t llvm::indexed_accessor_iterator< DerivedT, BaseT, T, PointerT, ReferenceT >::operator- ( const indexed_accessor_iterator< DerivedT, BaseT, T, PointerT, ReferenceT > & rhs) const
inline

Definition at line 1176 of file STLExtras.h.

References assert(), base, index, and indexed_accessor_iterator().

◆ operator-=()

template<typename DerivedT, typename BaseT, typename T, typename PointerT = T *, typename ReferenceT = T &>
DerivedT & llvm::indexed_accessor_iterator< DerivedT, BaseT, T, PointerT, ReferenceT >::operator-= ( ptrdiff_t offset)
inline

Definition at line 1193 of file STLExtras.h.

References index.

◆ operator<()

template<typename DerivedT, typename BaseT, typename T, typename PointerT = T *, typename ReferenceT = T &>
bool llvm::indexed_accessor_iterator< DerivedT, BaseT, T, PointerT, ReferenceT >::operator< ( const indexed_accessor_iterator< DerivedT, BaseT, T, PointerT, ReferenceT > & rhs) const
inline

Definition at line 1184 of file STLExtras.h.

References assert(), base, index, and indexed_accessor_iterator().

◆ operator==()

template<typename DerivedT, typename BaseT, typename T, typename PointerT = T *, typename ReferenceT = T &>
bool llvm::indexed_accessor_iterator< DerivedT, BaseT, T, PointerT, ReferenceT >::operator== ( const indexed_accessor_iterator< DerivedT, BaseT, T, PointerT, ReferenceT > & rhs) const
inline

Definition at line 1180 of file STLExtras.h.

References assert(), base, index, and indexed_accessor_iterator().

Member Data Documentation

◆ base

template<typename DerivedT, typename BaseT, typename T, typename PointerT = T *, typename ReferenceT = T &>
BaseT llvm::indexed_accessor_iterator< DerivedT, BaseT, T, PointerT, ReferenceT >::base
protected

Definition at line 1207 of file STLExtras.h.

Referenced by getBase(), indexed_accessor_iterator(), operator-(), operator<(), and operator==().

◆ index

template<typename DerivedT, typename BaseT, typename T, typename PointerT = T *, typename ReferenceT = T &>
ptrdiff_t llvm::indexed_accessor_iterator< DerivedT, BaseT, T, PointerT, ReferenceT >::index
protected

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