Class UnaryOperator<TParam, TResult>
Base class for query operator implementations.
Namespace: Reaqtive
Assembly: Reaqtive.Core.dll
Syntax
public abstract class UnaryOperator<TParam, TResult> : Object, IUnaryOperator, 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
UnaryOperator(TParam, IObserver<TResult>)
Creates a new operator instance using the given parameters and the observer to report downstream notifications to.
Declaration
protected UnaryOperator(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
Input
Gets the single input to the operator.
Declaration
public ISubscription Input { get; }
Property Value
Type | Description |
---|---|
ISubscription |
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 Start
ed. 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., Input = OnSubscribe();
. It is usually the case
that this method is called as the last thing the constructor does.
Declaration
protected virtual ISubscription OnSubscribe()
Returns
Type | Description |
---|---|
ISubscription | A child subscription. |
SetContext(IOperatorContext)
Sets the operator's context in which it operates. The context contains things like the reactive service, scheduler, and so on.
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 Input by calling OnSubscribe().
Declaration
public virtual void Subscribe()