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