UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IteratorAdapter.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreTypes.h"
7
8template <typename Base>
10
28template <typename Base>
29class TIteratorAdapter : public Base
30{
31public:
32 using BaseType = Base;
34 using ElementType = typename BaseType::ElementType;
35 using SizeType = typename BaseType::SizeType;
36
37 [[nodiscard]] TIteratorAdapter() = default;
38
42 template < typename... Args>
43 [[nodiscard]] TIteratorAdapter(EInPlace, Args&&... InArgs) : BaseType(Forward<Args>(InArgs)...)
44 {
45 }
46
48 {
49 return this->Dereference();
50 }
51
53 {
54 return &this->Dereference();
55 }
56
58 {
59 this->Increment();
60 return *this;
61 }
62
64 {
65 ThisType Temp = *this;
66 ++*this;
67 return Temp;
68 }
69
71 {
72 this->Decrement();
73 return *this;
74 }
75
77 {
78 ThisType Temp = *this;
79 --*this;
80 return Temp;
81 }
82
84 {
85 this->Increment(Offset);
86 return *this;
87 }
88
90 {
91 this->Decrement(Offset);
92 return *this;
93 }
94
96 {
97 ThisType Temp = *this;
98 return Temp += Offset;
99 }
100
102 {
103 ThisType Temp = *this;
104 return Temp -= Offset;
105 }
106
107protected:
108 // BaseType MUST implement at least forward iteration which is enforced with the "using" declaration.
109 using BaseType::Dereference;
110 using BaseType::Equals;
111 using BaseType::Increment;
112
113 template <typename AnyElementType>
114 friend class TIteratorAdapter;
115
116public:
118 {
119 return Equals(Right);
120 }
121
123 {
124 return !Equals(Right);
125 }
126};
EInPlace
Definition CoreMiscDefines.h:162
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
uint32 Offset
Definition VulkanMemory.cpp:4033
Definition IteratorAdapter.h:30
ThisType operator++(int)
Definition IteratorAdapter.h:63
ThisType operator--(int)
Definition IteratorAdapter.h:76
Base BaseType
Definition IteratorAdapter.h:32
bool operator==(const TIteratorAdapter &Right) const
Definition IteratorAdapter.h:117
ThisType operator-(SizeType Offset) const
Definition IteratorAdapter.h:101
ThisType & operator--()
Definition IteratorAdapter.h:70
ThisType & operator++()
Definition IteratorAdapter.h:57
ThisType & operator+=(SizeType Offset)
Definition IteratorAdapter.h:83
ElementType * operator->() const
Definition IteratorAdapter.h:52
typename BaseType::SizeType SizeType
Definition IteratorAdapter.h:35
bool operator!=(const TIteratorAdapter &Right) const
Definition IteratorAdapter.h:122
TIteratorAdapter(EInPlace, Args &&... InArgs)
Definition IteratorAdapter.h:43
ElementType & operator*() const
Definition IteratorAdapter.h:47
ThisType & operator-=(SizeType Offset)
Definition IteratorAdapter.h:89
ThisType operator+(SizeType Offset) const
Definition IteratorAdapter.h:95
typename BaseType::ElementType ElementType
Definition IteratorAdapter.h:34
TIteratorAdapter()=default