Class SynchronizationComputation<TIn, TOut>
- Namespace
- NMF.Synchronizations
- Assembly
- NMF.Synchronizations.dll
Denotes a computation in a synchronization
public abstract class SynchronizationComputation<TIn, TOut> : Computation, IPersistor, ITraceEntry, INotifyValue<TOut>, INotifiable, IDisposable, ISuccessorList
Type Parameters
TIn
TOut
- Inheritance
-
SynchronizationComputation<TIn, TOut>
- Implements
-
INotifyValue<TOut>
- Inherited Members
Constructors
SynchronizationComputation(TransformationRuleBase<TIn, TOut>, TransformationRuleBase<TOut, TIn>, IComputationContext, TIn)
Creates a new instance
public SynchronizationComputation(TransformationRuleBase<TIn, TOut> rule, TransformationRuleBase<TOut, TIn> reverseRule, IComputationContext context, TIn input)
Parameters
rule
TransformationRuleBase<TIn, TOut>The transformation rule for which this correspondence was created
reverseRule
TransformationRuleBase<TOut, TIn>The reverse transformation rule
context
IComputationContextThe context in which the correspondence is created
input
TInThe input element
Properties
AllSuccessors
Gets a collection of successors for the current computation
public IEnumerable<INotifiable> AllSuccessors { get; }
Property Value
Count
The number of elements
public int Count { get; }
Property Value
Dependencies
Gets the dependencies for this correspondence
public virtual ICollection<IDisposable> Dependencies { get; }
Property Value
ExecutionMetaData
Used by the execution engine during incremental execution.
public ExecutionMetaData ExecutionMetaData { get; }
Property Value
HasSuccessors
True, if there is any successor, otherwise False
public bool HasSuccessors { get; }
Property Value
Input
Gets the input of this correspondence
public TIn Input { get; set; }
Property Value
- TIn
IsAttached
True, if successors are attached, otherwise False
public bool IsAttached { get; }
Property Value
IsOriginalComputation
Gets whether this correspondence was the original one
public virtual bool IsOriginalComputation { get; }
Property Value
OmitCandidateSearch
Indicates whether candidate search can be skipped because the context was newly established
public bool OmitCandidateSearch { get; protected set; }
Property Value
Opposite
Gets the opposite correspondence
public SynchronizationComputation<TOut, TIn> Opposite { get; }
Property Value
- SynchronizationComputation<TOut, TIn>
OutputCore
Gets or sets the output in a derived class
protected override sealed object OutputCore { get; set; }
Property Value
Successors
The nodes that will get notified by this node.
public ISuccessorList Successors { get; }
Property Value
SynchronizationContext
The context in which the correspondence has been established
public ISynchronizationContext SynchronizationContext { get; }
Property Value
SynchronizationRule
Gets the synchronization rule of this correspondence
public SynchronizationRuleBase SynchronizationRule { get; }
Property Value
Methods
AcceptNewOutput(TOut)
public void AcceptNewOutput(TOut value)
Parameters
value
TOut
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
DoWhenOutputIsAvailable(Action<TIn, TOut>)
Performs the given action when the corresponding element of this computation was found
public void DoWhenOutputIsAvailable(Action<TIn, TOut> toPerform)
Parameters
toPerform
Action<TIn, TOut>The action to perform
GetInput(int)
Gets the input argument for this computation with the given index
public override object GetInput(int index)
Parameters
index
intThe index of the input parameter
Returns
- object
The input parameter at the ith position
GetSuccessor(int)
Gets the successor at the given index
public INotifiable GetSuccessor(int index)
Parameters
index
intThe index
Returns
- INotifiable
The DDG node with the given index
Notify(IList<INotificationResult>)
Gets called when one of the dependencies signals a notification.
public INotificationResult Notify(IList<INotificationResult> sources)
Parameters
sources
IList<INotificationResult>Contains information about what triggered this notification.
Returns
- INotificationResult
An object describing the changes that happened in this notification.
OnOutputChanged(ValueChangedEventArgs)
Fires the event that the output has changed
protected virtual void OnOutputChanged(ValueChangedEventArgs e)
Parameters
Set(INotifiable)
Add the given DDG node to the list
public void Set(INotifiable node)
Parameters
node
INotifiableThe DDG node to add
SetDummy()
Sets a dummy
public void SetDummy()
Unset(INotifiable, bool)
Unset the given DDG node as successor
public void Unset(INotifiable node, bool leaveDummy = false)
Parameters
node
INotifiablethe DDG node
leaveDummy
boolTrue, to leave the dummy in operation, otherwise False
UnsetAll()
Clear the list
public void UnsetAll()
Events
OutputChanged
Gets raised when the output of this synchronization changed
public event EventHandler<ValueChangedEventArgs> OutputChanged