LLVM 20.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]

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
 
size_t size () const
 Return the size of this range.
 
bool empty () const
 Return if the range is empty.
 
DerivedT slice (size_t n, size_t m) const
 Drop the first N elements, and keep M elements.
 
DerivedT drop_front (size_t n=1) const
 Drop the first n elements.
 
DerivedT drop_back (size_t n=1) const
 Drop the last n elements.
 
DerivedT take_front (size_t n=1) const
 Take the first n elements.
 
DerivedT take_back (size_t n=1) const
 Take the last n elements.
 
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.
 
const BaseT & getBase () const
 Returns the base of this range.
 

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.
 
ptrdiff_t count
 The size from the owning range.
 

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 1239 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 1241 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 1261 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 1264 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 1266 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

◆ 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

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

References llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::base.

◆ 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 1322 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 &>
ReferenceT llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::operator[] ( size_t  Index) const
inline

◆ 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

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

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: