LLVM  14.0.0git
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT > Class Template Reference

The class represents the base of a range of indexed_accessor_iterators. More...

#include "llvm/ADT/STLExtras.h"

Inheritance diagram for llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >:
Inheritance graph
[legend]
Collaboration diagram for llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >:
Collaboration graph
[legend]

Classes

class  iterator
 An iterator element of this range. More...
 

Public Types

using RangeBaseT = indexed_accessor_range_base
 

Public Member Functions

 indexed_accessor_range_base (iterator begin, iterator end)
 
 indexed_accessor_range_base (const iterator_range< iterator > &range)
 
 indexed_accessor_range_base (BaseT base, ptrdiff_t count)
 
iterator begin () const
 
iterator end () const
 
ReferenceT operator[] (size_t Index) const
 
ReferenceT front () const
 
ReferenceT back () const
 
template<typename OtherT >
bool operator== (const OtherT &other) const
 Compare this range with another. More...
 
template<typename OtherT >
bool operator!= (const OtherT &other) const
 
size_t size () const
 Return the size of this range. More...
 
bool empty () const
 Return if the range is empty. More...
 
DerivedT slice (size_t n, size_t m) const
 Drop the first N elements, and keep M elements. More...
 
DerivedT drop_front (size_t n=1) const
 Drop the first n elements. More...
 
DerivedT drop_back (size_t n=1) const
 Drop the last n elements. More...
 
DerivedT take_front (size_t n=1) const
 Take the first n elements. More...
 
DerivedT take_back (size_t n=1) const
 Take the last n elements. More...
 
template<typename RangeT , typename = std::enable_if_t<std::is_constructible< RangeT, iterator_range<iterator>>::value>>
 operator RangeT () const
 Allow conversion to any type accepting an iterator_range. More...
 
const BaseT & getBase () const
 Returns the base of this range. More...
 

Protected Member Functions

 indexed_accessor_range_base (const indexed_accessor_range_base &)=default
 
 indexed_accessor_range_base (indexed_accessor_range_base &&)=default
 
indexed_accessor_range_baseoperator= (const indexed_accessor_range_base &)=default
 

Protected Attributes

BaseT base
 The base that owns the provided range of values. More...
 
ptrdiff_t count
 The size from the owning range. More...
 

Detailed Description

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

The class represents the base of a range of indexed_accessor_iterators.

It provides support for many different range functionalities, e.g. drop_front/slice/etc.. Derived range classes must implement the following static methods:

Definition at line 1123 of file STLExtras.h.

Member Typedef Documentation

◆ RangeBaseT

template<typename DerivedT , typename BaseT , typename T , typename PointerT = T *, typename ReferenceT = T &>
using llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::RangeBaseT = indexed_accessor_range_base

Definition at line 1125 of file STLExtras.h.

Constructor & Destructor Documentation

◆ indexed_accessor_range_base() [1/5]

template<typename DerivedT , typename BaseT , typename T , typename PointerT = T *, typename ReferenceT = T &>
llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::indexed_accessor_range_base ( iterator  begin,
iterator  end 
)
inline

Definition at line 1145 of file STLExtras.h.

◆ indexed_accessor_range_base() [2/5]

template<typename DerivedT , typename BaseT , typename T , typename PointerT = T *, typename ReferenceT = T &>
llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::indexed_accessor_range_base ( const iterator_range< iterator > &  range)
inline

Definition at line 1148 of file STLExtras.h.

◆ indexed_accessor_range_base() [3/5]

template<typename DerivedT , typename BaseT , typename T , typename PointerT = T *, typename ReferenceT = T &>
llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::indexed_accessor_range_base ( BaseT  base,
ptrdiff_t  count 
)
inline

Definition at line 1150 of file STLExtras.h.

◆ indexed_accessor_range_base() [4/5]

template<typename DerivedT , typename BaseT , typename T , typename PointerT = T *, typename ReferenceT = T &>
llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::indexed_accessor_range_base ( const indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT > &  )
protecteddefault

◆ indexed_accessor_range_base() [5/5]

template<typename DerivedT , typename BaseT , typename T , typename PointerT = T *, typename ReferenceT = T &>
llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::indexed_accessor_range_base ( indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT > &&  )
protecteddefault

Member Function Documentation

◆ back()

template<typename DerivedT , typename BaseT , typename T , typename PointerT = T *, typename ReferenceT = T &>
ReferenceT llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::back ( ) const
inline

Definition at line 1163 of file STLExtras.h.

◆ begin()

template<typename DerivedT , typename BaseT , typename T , typename PointerT = T *, typename ReferenceT = T &>
iterator llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::begin ( ) const
inline

◆ drop_back()

template<typename DerivedT , typename BaseT , typename T , typename PointerT = T *, typename ReferenceT = T &>
DerivedT llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::drop_back ( size_t  n = 1) const
inline

◆ drop_front()

template<typename DerivedT , typename BaseT , typename T , typename PointerT = T *, typename ReferenceT = T &>
DerivedT llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::drop_front ( size_t  n = 1) const
inline

◆ empty()

template<typename DerivedT , typename BaseT , typename T , typename PointerT = T *, typename ReferenceT = T &>
bool llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::empty ( ) const
inline

◆ end()

template<typename DerivedT , typename BaseT , typename T , typename PointerT = T *, typename ReferenceT = T &>
iterator llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::end ( ) const
inline

◆ front()

template<typename DerivedT , typename BaseT , typename T , typename PointerT = T *, typename ReferenceT = T &>
ReferenceT llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::front ( ) const
inline

Definition at line 1159 of file STLExtras.h.

◆ getBase()

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

Returns the base of this range.

Definition at line 1221 of file STLExtras.h.

◆ operator RangeT()

template<typename DerivedT , typename BaseT , typename T , typename PointerT = T *, typename ReferenceT = T &>
template<typename RangeT , typename = std::enable_if_t<std::is_constructible< RangeT, iterator_range<iterator>>::value>>
llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::operator RangeT ( ) const
inline

Allow conversion to any type accepting an iterator_range.

Definition at line 1216 of file STLExtras.h.

◆ operator!=()

template<typename DerivedT , typename BaseT , typename T , typename PointerT = T *, typename ReferenceT = T &>
template<typename OtherT >
bool llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::operator!= ( const OtherT &  other) const
inline

Definition at line 1174 of file STLExtras.h.

◆ operator=()

template<typename DerivedT , typename BaseT , typename T , typename PointerT = T *, typename ReferenceT = T &>
indexed_accessor_range_base& llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::operator= ( const indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT > &  )
protecteddefault

◆ operator==()

template<typename DerivedT , typename BaseT , typename T , typename PointerT = T *, typename ReferenceT = T &>
template<typename OtherT >
bool llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::operator== ( const OtherT &  other) const
inline

Compare this range with another.

Definition at line 1169 of file STLExtras.h.

◆ operator[]()

template<typename DerivedT , typename BaseT , typename T , typename PointerT = T *, typename ReferenceT = T &>
ReferenceT llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::operator[] ( size_t  Index) const
inline

Definition at line 1155 of file STLExtras.h.

◆ size()

template<typename DerivedT , typename BaseT , typename T , typename PointerT = T *, typename ReferenceT = T &>
size_t llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::size ( ) const
inline

◆ slice()

template<typename DerivedT , typename BaseT , typename T , typename PointerT = T *, typename ReferenceT = T &>
DerivedT llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::slice ( size_t  n,
size_t  m 
) const
inline

Drop the first N elements, and keep M elements.

Definition at line 1185 of file STLExtras.h.

Referenced by llvm::detail::indexed_accessor_range_base< DerivedT, std::pair< BaseT, ptrdiff_t >, T, T *, T & >::drop_front().

◆ take_back()

template<typename DerivedT , typename BaseT , typename T , typename PointerT = T *, typename ReferenceT = T &>
DerivedT llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::take_back ( size_t  n = 1) const
inline

Take the last n elements.

Definition at line 1208 of file STLExtras.h.

◆ take_front()

template<typename DerivedT , typename BaseT , typename T , typename PointerT = T *, typename ReferenceT = T &>
DerivedT llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::take_front ( size_t  n = 1) const
inline

Take the first n elements.

Definition at line 1202 of file STLExtras.h.

Member Data Documentation

◆ base

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

◆ count

template<typename DerivedT , typename BaseT , typename T , typename PointerT = T *, typename ReferenceT = T &>
ptrdiff_t llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::count
protected

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