LLVM  14.0.0git
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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 >:
Inheritance graph
[legend]
Collaboration diagram for llvm::indexed_accessor_iterator< DerivedT, BaseT, T, PointerT, ReferenceT >:
Collaboration graph
[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. More...
 
const BaseT & getBase () const
 Returns the current base of the iterator. More...
 
- 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++ (int)
 
DerivedT & operator-- ()
 
DerivedT operator-- (int)
 
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 = std::random_access_iterator_tag
 
using value_type = T
 
using difference_type = std::ptrdiff_t
 
using pointer = T *
 
using reference = T &
 
- 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 1071 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 1104 of file STLExtras.h.

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 1101 of file STLExtras.h.

◆ 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 1098 of file STLExtras.h.

◆ 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 1088 of file STLExtras.h.

◆ 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 1076 of file STLExtras.h.

◆ 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 1092 of file STLExtras.h.

◆ 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 1083 of file STLExtras.h.

◆ 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 1080 of file STLExtras.h.

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

◆ 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: