Static Value-Flow Analysis
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Friends | List of all members
SVF::iter_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT > Class Template Reference

#include <iterator.h>

Inheritance diagram for SVF::iter_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >:
SVF::iter_facade_base< DerivedT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT > SVF::mapped_iter< ItTy, FuncTy, FuncReturnTy > SVF::pointee_iter< WrappedIteratorT, T > SVF::pointer_iterator< WrappedIteratorT, T >

Public Types

using difference_type = DifferenceTypeT
 
- Public Types inherited from SVF::iter_facade_base< DerivedT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >
using iterator_category = IteratorCategoryT
 
using value_type = T
 
using difference_type = DifferenceTypeT
 
using pointer = PointerT
 
using reference = ReferenceT
 

Public Member Functions

DerivedToperator+= (difference_type n)
 
DerivedToperator-= (difference_type n)
 
difference_type operator- (const DerivedT &RHS) const
 
DerivedToperator++ ()
 
DerivedToperator-- ()
 
ReferenceT operator* () const
 
- Public Member Functions inherited from SVF::iter_facade_base< DerivedT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >
DerivedT operator+ (DifferenceTypeT n) const
 
DerivedT operator- (DifferenceTypeT n) const
 
DerivedToperator++ ()
 
DerivedT operator++ (int)
 
DerivedToperator-- ()
 
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
 
PointerT operator-> ()
 
PointerT operator-> () const
 
ReferenceProxy operator[] (DifferenceTypeT n)
 
ReferenceProxy operator[] (DifferenceTypeT n) const
 

Protected Member Functions

 iter_adaptor_base ()=default
 
 iter_adaptor_base (WrappedIteratorT u)
 
const WrappedIteratorTwrapped () const
 

Protected Attributes

WrappedIteratorT I
 

Private Types

using BaseT = typename iter_adaptor_base::iter_facade_base
 

Friends

bool operator== (const iter_adaptor_base &LHS, const iter_adaptor_base &RHS)
 
bool operator< (const iter_adaptor_base &LHS, const iter_adaptor_base &RHS)
 

Additional Inherited Members

- Protected Types inherited from SVF::iter_facade_base< DerivedT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >
enum  { IsRandomAccess , IsBidirectional }
 

Detailed Description

template<typename DerivedT, typename WrappedIteratorT, typename IteratorCategoryT = typename std::iterator_traits<WrappedIteratorT>::iterator_category, typename T = typename std::iterator_traits<WrappedIteratorT>::value_type, typename DifferenceTypeT = typename std::iterator_traits<WrappedIteratorT>::difference_type, typename PointerT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::pointer, T *>, typename ReferenceT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::reference, T &>>
class SVF::iter_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >

CRTP base class for adapting an iterator to a different type.

This class can be used through CRTP to adapt one iterator into another. Typically this is done through providing in the derived class a custom operator* implementation. Other methods can be overridden as well.

Definition at line 235 of file iterator.h.

Member Typedef Documentation

◆ BaseT

template<typename DerivedT , typename WrappedIteratorT , typename IteratorCategoryT = typename std::iterator_traits<WrappedIteratorT>::iterator_category, typename T = typename std::iterator_traits<WrappedIteratorT>::value_type, typename DifferenceTypeT = typename std::iterator_traits<WrappedIteratorT>::difference_type, typename PointerT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::pointer, T *>, typename ReferenceT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::reference, T &>>
using SVF::iter_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::BaseT = typename iter_adaptor_base::iter_facade_base
private

Definition at line 239 of file iterator.h.

◆ difference_type

template<typename DerivedT , typename WrappedIteratorT , typename IteratorCategoryT = typename std::iterator_traits<WrappedIteratorT>::iterator_category, typename T = typename std::iterator_traits<WrappedIteratorT>::value_type, typename DifferenceTypeT = typename std::iterator_traits<WrappedIteratorT>::difference_type, typename PointerT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::pointer, T *>, typename ReferenceT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::reference, T &>>
using SVF::iter_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::difference_type = DifferenceTypeT

Definition at line 258 of file iterator.h.

Constructor & Destructor Documentation

◆ iter_adaptor_base() [1/2]

template<typename DerivedT , typename WrappedIteratorT , typename IteratorCategoryT = typename std::iterator_traits<WrappedIteratorT>::iterator_category, typename T = typename std::iterator_traits<WrappedIteratorT>::value_type, typename DifferenceTypeT = typename std::iterator_traits<WrappedIteratorT>::difference_type, typename PointerT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::pointer, T *>, typename ReferenceT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::reference, T &>>
SVF::iter_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::iter_adaptor_base ( )
protecteddefault

◆ iter_adaptor_base() [2/2]

template<typename DerivedT , typename WrappedIteratorT , typename IteratorCategoryT = typename std::iterator_traits<WrappedIteratorT>::iterator_category, typename T = typename std::iterator_traits<WrappedIteratorT>::value_type, typename DifferenceTypeT = typename std::iterator_traits<WrappedIteratorT>::difference_type, typename PointerT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::pointer, T *>, typename ReferenceT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::reference, T &>>
SVF::iter_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::iter_adaptor_base ( WrappedIteratorT  u)
inlineexplicitprotected

Definition at line 246 of file iterator.h.

246 : I(std::move(u))
247 {
248 static_assert(std::is_base_of<iter_adaptor_base, DerivedT>::value,
249 "Must pass the derived type to this template!");
250 }
WrappedIteratorT I
Definition iterator.h:242
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

Member Function Documentation

◆ operator*()

template<typename DerivedT , typename WrappedIteratorT , typename IteratorCategoryT = typename std::iterator_traits<WrappedIteratorT>::iterator_category, typename T = typename std::iterator_traits<WrappedIteratorT>::value_type, typename DifferenceTypeT = typename std::iterator_traits<WrappedIteratorT>::difference_type, typename PointerT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::pointer, T *>, typename ReferenceT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::reference, T &>>
ReferenceT SVF::iter_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::operator* ( ) const
inline

Definition at line 317 of file iterator.h.

318 {
319 return *I;
320 }

◆ operator++()

template<typename DerivedT , typename WrappedIteratorT , typename IteratorCategoryT = typename std::iterator_traits<WrappedIteratorT>::iterator_category, typename T = typename std::iterator_traits<WrappedIteratorT>::value_type, typename DifferenceTypeT = typename std::iterator_traits<WrappedIteratorT>::difference_type, typename PointerT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::pointer, T *>, typename ReferenceT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::reference, T &>>
DerivedT & SVF::iter_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::operator++ ( )
inline

Definition at line 288 of file iterator.h.

289 {
290 ++I;
291 return *static_cast<DerivedT *>(this);
292 }

◆ operator+=()

template<typename DerivedT , typename WrappedIteratorT , typename IteratorCategoryT = typename std::iterator_traits<WrappedIteratorT>::iterator_category, typename T = typename std::iterator_traits<WrappedIteratorT>::value_type, typename DifferenceTypeT = typename std::iterator_traits<WrappedIteratorT>::difference_type, typename PointerT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::pointer, T *>, typename ReferenceT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::reference, T &>>
DerivedT & SVF::iter_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::operator+= ( difference_type  n)
inline

Definition at line 260 of file iterator.h.

261 {
262 static_assert(
263 BaseT::IsRandomAccess,
264 "The '+=' operator is only defined for random access iterators.");
265 I += n;
266 return *static_cast<DerivedT *>(this);
267 }
cJSON * n
Definition cJSON.cpp:2558

◆ operator-()

template<typename DerivedT , typename WrappedIteratorT , typename IteratorCategoryT = typename std::iterator_traits<WrappedIteratorT>::iterator_category, typename T = typename std::iterator_traits<WrappedIteratorT>::value_type, typename DifferenceTypeT = typename std::iterator_traits<WrappedIteratorT>::difference_type, typename PointerT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::pointer, T *>, typename ReferenceT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::reference, T &>>
difference_type SVF::iter_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::operator- ( const DerivedT RHS) const
inline

Definition at line 277 of file iterator.h.

278 {
279 static_assert(
280 BaseT::IsRandomAccess,
281 "The '-' operator is only defined for random access iterators.");
282 return I - RHS.I;
283 }

◆ operator--()

template<typename DerivedT , typename WrappedIteratorT , typename IteratorCategoryT = typename std::iterator_traits<WrappedIteratorT>::iterator_category, typename T = typename std::iterator_traits<WrappedIteratorT>::value_type, typename DifferenceTypeT = typename std::iterator_traits<WrappedIteratorT>::difference_type, typename PointerT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::pointer, T *>, typename ReferenceT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::reference, T &>>
DerivedT & SVF::iter_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::operator-- ( )
inline

Definition at line 294 of file iterator.h.

295 {
296 static_assert(
297 BaseT::IsBidirectional,
298 "The decrement operator is only defined for bidirectional iterators.");
299 --I;
300 return *static_cast<DerivedT *>(this);
301 }

◆ operator-=()

template<typename DerivedT , typename WrappedIteratorT , typename IteratorCategoryT = typename std::iterator_traits<WrappedIteratorT>::iterator_category, typename T = typename std::iterator_traits<WrappedIteratorT>::value_type, typename DifferenceTypeT = typename std::iterator_traits<WrappedIteratorT>::difference_type, typename PointerT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::pointer, T *>, typename ReferenceT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::reference, T &>>
DerivedT & SVF::iter_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::operator-= ( difference_type  n)
inline

Definition at line 268 of file iterator.h.

269 {
270 static_assert(
271 BaseT::IsRandomAccess,
272 "The '-=' operator is only defined for random access iterators.");
273 I -= n;
274 return *static_cast<DerivedT *>(this);
275 }

◆ wrapped()

template<typename DerivedT , typename WrappedIteratorT , typename IteratorCategoryT = typename std::iterator_traits<WrappedIteratorT>::iterator_category, typename T = typename std::iterator_traits<WrappedIteratorT>::value_type, typename DifferenceTypeT = typename std::iterator_traits<WrappedIteratorT>::difference_type, typename PointerT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::pointer, T *>, typename ReferenceT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::reference, T &>>
const WrappedIteratorT & SVF::iter_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::wrapped ( ) const
inlineprotected

Definition at line 252 of file iterator.h.

253 {
254 return I;
255 }

Friends And Related Symbol Documentation

◆ operator<

template<typename DerivedT , typename WrappedIteratorT , typename IteratorCategoryT = typename std::iterator_traits<WrappedIteratorT>::iterator_category, typename T = typename std::iterator_traits<WrappedIteratorT>::value_type, typename DifferenceTypeT = typename std::iterator_traits<WrappedIteratorT>::difference_type, typename PointerT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::pointer, T *>, typename ReferenceT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::reference, T &>>
bool operator< ( const iter_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT > &  LHS,
const iter_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT > &  RHS 
)
friend

Definition at line 308 of file iterator.h.

310 {
311 static_assert(
312 BaseT::IsRandomAccess,
313 "Relational operators are only defined for random access iterators.");
314 return LHS.I < RHS.I;
315 }

◆ operator==

template<typename DerivedT , typename WrappedIteratorT , typename IteratorCategoryT = typename std::iterator_traits<WrappedIteratorT>::iterator_category, typename T = typename std::iterator_traits<WrappedIteratorT>::value_type, typename DifferenceTypeT = typename std::iterator_traits<WrappedIteratorT>::difference_type, typename PointerT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::pointer, T *>, typename ReferenceT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::reference, T &>>
bool operator== ( const iter_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT > &  LHS,
const iter_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT > &  RHS 
)
friend

Definition at line 303 of file iterator.h.

305 {
306 return LHS.I == RHS.I;
307 }

Member Data Documentation

◆ I

template<typename DerivedT , typename WrappedIteratorT , typename IteratorCategoryT = typename std::iterator_traits<WrappedIteratorT>::iterator_category, typename T = typename std::iterator_traits<WrappedIteratorT>::value_type, typename DifferenceTypeT = typename std::iterator_traits<WrappedIteratorT>::difference_type, typename PointerT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::pointer, T *>, typename ReferenceT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::reference, T &>>
WrappedIteratorT SVF::iter_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::I
protected

Definition at line 242 of file iterator.h.


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