![]() |
ezEngine
Release 25.03
|
This class uses delegates to define a range of values that can be enumerated using a forward iterator. More...
#include <RangeView.h>
Classes | |
struct | ConstIterator |
Const iterator, don't use directly, use ranged based for loops or call begin() end(). More... | |
struct | Iterator |
Iterator, don't use directly, use ranged based for loops or call begin() end(). More... | |
Public Types | |
using | BeginCallback = ezDelegate< IteratorType()> |
using | EndCallback = ezDelegate< IteratorType()> |
using | NextCallback = ezDelegate< void(IteratorType &)> |
using | ValueCallback = ezDelegate< ValueType(const IteratorType &)> |
Public Member Functions | |
EZ_ALWAYS_INLINE | ezRangeView (BeginCallback begin, EndCallback end, NextCallback next, ValueCallback value) |
Initializes the ezRangeView with the delegates used to enumerate the range. | |
Iterator | begin () |
Iterator | end () |
ConstIterator | begin () const |
ConstIterator | end () const |
ConstIterator | cbegin () const |
ConstIterator | cend () const |
Friends | |
struct | Iterator |
struct | ConstIterator |
This class uses delegates to define a range of values that can be enumerated using a forward iterator.
Can be used to create a contiguous view to elements of a certain type without the need for them to actually exist in the same space or format. Think of IEnumerable in c# using composition via ezDelegate instead of derivation. ValueType defines the value type we are iterating over and IteratorType is the internal key to identify an element. An example that creates a RangeView of strings that are stored in a linear array of structs.