Show / Hide Table of Contents

Class Operator<TParam, TResult>

Base class for query operator implementations.

Inheritance
System.Object
Operator<TParam, TResult>
VersionedOperator<TParam, TResult>
Implements
IOperator
ISubscription
System.IDisposable
Namespace: Reaqtive
Assembly: Reaqtive.Core.dll
Syntax
public abstract class Operator<TParam, TResult> : Object, IOperator, ISubscription, IDisposable
Type Parameters
Name Description
TParam

Type of the parameters passed to the observer.

TResult

Element type of the result sequence produced by the operator.

Constructors

Operator(TParam, IObserver<TResult>)

Creates a new operator instance using the given parameters and the observer to report downstream notifications to.

Declaration
protected Operator(TParam parent, IObserver<TResult> observer)
Parameters
Type Name Description
TParam parent

Parameters used by the operator.

System.IObserver<TResult> observer

Observer receiving the operator's output.

Properties

Inputs

Gets a list of upstream subscriptions established by the operator.

Declaration
public IEnumerable<ISubscription> Inputs { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<ISubscription>

IsDisposed

Returns whether the operator has been disposed.

Declaration
protected bool IsDisposed { get; }
Property Value
Type Description
System.Boolean

Output

The observer that is subscribed to the operator. Is set when the object is instantiated.

Declaration
protected IObserver<TResult> Output { get; }
Property Value
Type Description
System.IObserver<TResult>

Params

Gets the parameters used by the operator. These parameters may include subscribable objects representing input sequences for the operator.

Declaration
protected TParam Params { get; }
Property Value
Type Description
TParam

Methods

Accept(ISubscriptionVisitor)

Accepts a visitor. Useful, e.g., when we want to perform an action on all the subscriptions in the graph (e.g., call OnSubscribe). The visitor will traverse the graph and perform actions on subscriptions. Accept will accept such actions to be performed.

Declaration
public void Accept(ISubscriptionVisitor visitor)
Parameters
Type Name Description
ISubscriptionVisitor visitor

Visitor performing the action.

Dispose()

Defines how the operator is disposed of.

Declaration
public void Dispose()

Dispose(Boolean)

Disposes the object.

Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
System.Boolean disposing

true if called from System.IDisposable.Dispose; otherwise, false.

OnDispose()

Defines behavior immediately after we Dispose of the operator. This method is usually called at the very end of the Dispose method.

Declaration
protected virtual void OnDispose()

OnStart()

Defines behavior immediately after operator is Started. This method is usually called at the very end of the Start method.

Declaration
protected virtual void OnStart()

OnSubscribe()

Defines behavior immediately after operator is subscribed to. This method is generally responsible for subscribe'ing the operator to the Params, e.g., Inputs = OnSubscribe();.

Declaration
protected virtual IEnumerable<ISubscription> OnSubscribe()
Returns
Type Description
System.Collections.Generic.IEnumerable<ISubscription>

Enumerable containing the subscriptions.

SetContext(IOperatorContext)

Sets the operator's context in which it operates. The context contains things like the scheduler and provides access to the hosting environment, if any.

Declaration
public virtual void SetContext(IOperatorContext context)
Parameters
Type Name Description
IOperatorContext context

Context in which the operator operates.

Start()

Called after the state and/or context are completely initialized; generally subscribes operator to sources, etc.

Declaration
public void Start()

Subscribe()

Initializes Inputs by calling OnSubscribe().

Declaration
public virtual void Subscribe()

Implements

IOperator
ISubscription
System.IDisposable
In This Article
Back to top Generated by DocFX