OpenTAP 9.34
API Reference
OpenTap.ScalarResultSink< T > Class Template Reference

ResultSink that will provide the first result from a given result column published by a given TestStep. When SourceTestStep is inside a loop step, only results from the last iteration of SourceTestStep is accessible. More...

Inheritance diagram for OpenTap.ScalarResultSink< T >:
OpenTap.IResultSink

Public Member Functions

 ScalarResultSink (ITestStep listeningStep)
 Creates an instance. This should probably be called from the constructor of the TestStep.
 
GetResult (CancellationToken ct)
 Called by TestSteps when the result is needed. Blocks until a result is available.
 
bool TryGetResult (out T result)
 Called by TestSteps when the result is needed. Returns true if a result is available.
 
void OnTestStepRunStart (TestStepRun run)
 Resets result collection when a new run of the SourceTestStep is started.
 
void OnTestStepRunCompleted (TestStepRun run)
 Called when a TestStep is completed.
 
void OnResultPublished (TestStepRun stepRun, ResultTable result)
 Called by OpenTAP when the source TestStep publishes results. This is happening in a background thread.
 
void OnTestPlanRunStart (TestPlanRun run)
 Initializes this instance.
 
void OnTestPlanRunCompleted (TestPlanRun run)
 Cleans up after this instance.
 
- Public Member Functions inherited from OpenTap.IResultSink

Properties

ITestStep SourceTestStep [get, set]
 The ID of the source TestStep that we are interested in results from.
 
string ResultColumnName [get, set]
 The name of the result column to get the result from.
 

Detailed Description

ResultSink that will provide the first result from a given result column published by a given TestStep. When SourceTestStep is inside a loop step, only results from the last iteration of SourceTestStep is accessible.

Type Constraints
T :IConvertible 

Constructor & Destructor Documentation

◆ ScalarResultSink()

OpenTap.ScalarResultSink< T >.ScalarResultSink ( ITestStep listeningStep)
inline

Creates an instance. This should probably be called from the constructor of the TestStep.

public class ListeningStepExample : TestStep
{
public ITestStep SourceStep { get => Sink.SourceTestStep; set => Sink.SourceTestStep = value; }
public ScalarResultSink<double> Sink { get; set; }
public ListeningStepExample()
{
Sink = new ScalarResultSink<double>(this);
}
public override void Run()
{
log.Debug("Result was: {0}", Sink.GetResult(TapThread.Current.AbortToken));
}
}
ResultSink that will provide the first result from a given result column published by a given TestSte...
Definition IResultSink.cs:146
All TestSteps that are instances of the TestStep abstract class should override the TestStep....
Definition TestStep.cs:34
void Run()
Called by TestPlan.Run() to run each TestStep. If this step has children (ChildTestSteps....
An interface for a TestStep. All TestSteps are instances of the ITestStep interface.
Definition ITestStep.cs:53
Parameters
listeningStep

OpenTAP 9.34 API built Wed Jul 1 2026 09:21:15