TStridedView

[TStridedView](API\Runtime\Core\Containers\TStridedView) is similar to [TArrayView](API\Runtime\Core\Containers\TArrayView), but allows flexible byte stride between elements.

Choose your operating system:

Windows

macOS

Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Containers/StridedView.h

Include

#include "Containers/StridedView.h"

Syntax

template<typename InElementType, typename InSizeType>
class TStridedView

Remarks

TStridedView is similar to TArrayView, but allows flexible byte stride between elements. Stride must be positive and a multiple of the element alignment. Stride can be zero to duplicate the same element over the whole range.

Example usage:

struct FMyStruct { uint32 SomeData; FVector Position; };

FVector ComputeMean(TStridedView<const FVector> Positions) { return Algo::Accumulate) / Positions.Num(); }

FVector ComputeMeanPosition(TArrayView<const FMyStruct> Structs) { return ComputeMean(MakeStridedView(Structs, &FMyStruct::Position)) }

See StridedViewTest.cpp for more examples.Pointer with extent and a stride, similar to TArrayView. Designed to allow functions to take pointers to arbitrarily structured data.

Constructors

Name Description

Public function

TStridedView()

Public function

TStridedView

(
    const TStridedView< OtherElementTyp...
)

Public function

TStridedView

(
    SizeType InBytesBetweenElements,
    OtherElementType* InFirstEleme...,
    SizeType InNumElements
)

Functions

Name Description

Public function Const

FIterator

 

begin()

Ranged iteration support. DO NOT USE DIRECTLY.

Public function Const

FIterator

 

end()

Public function Const

SizeType

 

GetStride()

Public function Const

SizeType

 

Num()

Operators

Name Description

Public function Const

ElementType ...

 

operator[]

(
    SizeType Index
)

Classes

Name

Description

Public struct

FIterator

Typedefs

Name

Description

ElementType

SizeType