class TArrayView

template<class Type>

Provides a way to access elements of any array type (e.g.

TArray, TInlineArray, Vector, FrameVector). The view provides direct access to the array data. The caller must ensure the viewed array is not destroyed or reallocated while the view is active.

Public

Constructors

TArrayView<Type>

TArrayView<Type>() = default

TArrayView<Type>

TArrayView<Type>(const TArrayView<Type> &other) = default

TArrayView<Type>

TArrayView<Type>(TArrayView<Type> &&other) = default

TArrayView<Type>

TArrayView<Type>(ValueType *data, u64 size)

TArrayView<Type>

TArrayView<Type>(std::nullptr_t, u64)

TArrayView<Type>

TArrayView<Type>(std::initializer_list<Type> initializerList)

Methods

~TArrayView<Type>

~TArrayView<Type>() = default

IsEmpty

bool IsEmpty() const

Begin

Iterator Begin()

End

Iterator End()

Begin

ConstIterator Begin() const

End

ConstIterator End() const

Cbegin

ConstIterator Cbegin() const

Cend

ConstIterator Cend() const

Rbegin

ReverseIterator Rbegin()

Rend

ReverseIterator Rend()

Rbegin

ConstReverseIterator Rbegin() const

Rend

ConstReverseIterator Rend() const

Crbegin

ConstReverseIterator Crbegin() const

Crend

ConstReverseIterator Crend() const

Size

u64 Size() const

Data

Type *Data()

Data

const Type *Data() const

Front

Type &Front()

Back

Type &Back()

Front

const Type &Front() const

Back

const Type &Back() const

Subset

TArrayView<Type> Subset(u64 offset, u64 count = 0) const

Returns a view into a subset of this array.

offset
Starting index of the subset.
count
Number of elements in the subset. If 0, includes all elements from offset to the end.

Returns: A new TArrayView representing the subset.

Contains

bool Contains(const Type &element)

begin

Iterator begin()

end

Iterator end()

begin

ConstIterator begin() const

end

ConstIterator end() const

cbegin

ConstIterator cbegin() const

cend

ConstIterator cend() const

rbegin

ReverseIterator rbegin()

rend

ReverseIterator rend()

rbegin

ConstReverseIterator rbegin() const

rend

ConstReverseIterator rend() const

crbegin

ConstReverseIterator crbegin() const

crend

ConstReverseIterator crend() const

size

u64 size() const

data

Type *data()

data

const Type *data() const

front

Type &front()

front

const Type &front() const

back

Type &back()

back

const Type &back() const

Operators

operator=

TArrayView<Type> &operator=(const TArrayView<Type> &other) = default

operator=

TArrayView<Type> &operator=(TArrayView<Type> &&other) = default

operator==

bool operator==(const TArrayView<Type> &other)

operator!=

bool operator!=(const TArrayView<Type> &other)

operator<

bool operator<(const TArrayView<Type> &other) const

operator>

bool operator>(const TArrayView<Type> &other) const

operator<=

bool operator<=(const TArrayView<Type> &other) const

operator>=

bool operator>=(const TArrayView<Type> &other) const

operator[]

Type &operator[](u64 index)

operator[]

const Type &operator[](u64 index) const

Private

Fields

mData

Type * mData

mSize

u64 mSize