Class UZagalaSpecContextExtensionExamplesIterator#

Inheritance Relationships#

Base Types#

Derived Type#

Class Documentation#

class UZagalaSpecContextExtensionExamplesIterator : public UZagalaSpecDefaultExecutionStep, public IZagalaSpecIterationController#

Examples-driven context extension that iterates through UZagalaSpecTaggedDataCollection entries of a UZagalaSpecTaggedDataExamples asset, loading tagged data objects into the context cache for each iteration pass.

This enables data-driven testing patterns where scenarios execute multiple times with different test data loaded from a typed data asset.

Structure:

Lifecycle:

When used within a TextStep, the examples asset will be loaded from the assigned capture group’s ExampleAsset property, if present. Otherwise, the ExamplesAsset property of this extension is used.

Subclassed by UZagalaSpecCEInventoryIterator

IZagalaSpecExecutionStep

virtual void Setup_Implementation(FZagalaSpecExecutionStepData StepData) override#

Sets up this execution step before it is executed.

Parameters:

StepData – The execution data (e.g. capture group customizer) used to configure this step.

Public Functions

UZagalaSpecContextExtensionExamplesIterator(const FObjectInitializer &ObjectInitializer = FObjectInitializer::Get())#
virtual bool HasPendingIteration_Implementation() override#

Returns true if there are more collections to process, false otherwise.

virtual void UpdateIteration_Implementation() override#

Advances internal state to the next iteration (e.g.

increment index).

virtual void PostEditChangeProperty(FPropertyChangedEvent &PropertyChangedEvent) override#

Detects ExamplesAsset changes to clear LoadedExamples.

inline const TSoftObjectPtr<UZagalaSpecTaggedDataExamples> &GetExamplesAsset() const#

Returns the soft reference to the examples asset (may be null if not yet assigned).

Returns:

The soft reference to ExamplesAsset.

inline UZagalaSpecTaggedDataExamples *GetLoadedExamples() const#

Returns the resolved examples asset (may be null if not yet loaded or Setup not called).

Returns:

The loaded examples asset, or nullptr.

Protected Functions

virtual void InternalExecute_Implementation(const TScriptInterface<IZagalaSpecTaggedDataCacher> &AssignedCacher) override#

Loads the current collection from the examples asset and stores its tagged data in the assigned cache.

Calls BroadcastSuccess() when complete, or BroadcastFailure() if the asset is null or collection is invalid.

virtual void InternalTeardown_Implementation() override#

Native implementation of InternalTeardown(); does nothing by default.

virtual bool LoadExamples()#

Loads the examples asset from the soft reference if not already loaded.

Returns:

true if the examples asset is loaded and valid, false otherwise

Protected Attributes

TSoftObjectPtr<UZagalaSpecTaggedDataExamples> ExamplesAsset#

Soft reference to the examples asset containing tagged data collections to iterate through.

TObjectPtr<UZagalaSpecTaggedDataExamples> LoadedExamples#

Cached examples asset resolved from ExamplesAsset on first InternalExecute() call.

int32 CurrentCollectionIndex = 0#

Current collection index being processed (0-based).

bool bHasError = false#

Flag to track if an error occurred (prevents further iteration).