Class VariableDependencyCollection<TInstruction>
- Namespace
- Echo.DataFlow.Collections
- Assembly
- Echo.DataFlow.dll
Represents a collection of variables and their symbolic values that a node in a data flow graph depends on.
public class VariableDependencyCollection<TInstruction> : ICollection<VariableDependency<TInstruction>>, IEnumerable<VariableDependency<TInstruction>>, IEnumerable where TInstruction : notnull
Type Parameters
TInstructionThe type of instruction to put in each node.
- Inheritance
-
VariableDependencyCollection<TInstruction>
- Implements
-
ICollection<VariableDependency<TInstruction>>IEnumerable<VariableDependency<TInstruction>>
- Inherited Members
Properties
Count
public int Count { get; }
Property Value
EdgeCount
Gets the total number of edges that are stored in this dependency collection.
public int EdgeCount { get; }
Property Value
IsReadOnly
public bool IsReadOnly { get; }
Property Value
this[IVariable]
Gets or sets the variable dependency assigned to the variable.
public VariableDependency<TInstruction> this[IVariable variable] { get; set; }
Parameters
variableIVariableThe variable
Property Value
- VariableDependency<TInstruction>
Methods
Add(VariableDependency<TInstruction>)
Adds a variable dependency to the node.
public void Add(VariableDependency<TInstruction> dependency)
Parameters
dependencyVariableDependency<TInstruction>The dependency to add.
Clear()
public void Clear()
Contains(VariableDependency<TInstruction>)
public bool Contains(VariableDependency<TInstruction> item)
Parameters
itemVariableDependency<TInstruction>
Returns
ContainsVariable(IVariable)
Determines whether the provided variable is registered as a dependency.
public bool ContainsVariable(IVariable variable)
Parameters
variableIVariableThe dependency.
Returns
CopyTo(VariableDependency<TInstruction>[], int)
public void CopyTo(VariableDependency<TInstruction>[] array, int arrayIndex)
Parameters
arrayVariableDependency<TInstruction>[]arrayIndexint
GetEnumerator()
Obtains an enumerator that enumerates all recorded variable dependencies in this collection.
public VariableDependencyCollection<TInstruction>.Enumerator GetEnumerator()
Returns
- VariableDependencyCollection<TInstruction>.Enumerator
The enumerator.
GetRegisteredVariables()
Obtains a collection of variables that are registered in the dependency.
public IEnumerable<IVariable> GetRegisteredVariables()
Returns
- IEnumerable<IVariable>
The variables.
Remove(IVariable)
Unregisters a variable as a dependency.
public bool Remove(IVariable variable)
Parameters
variableIVariableThe variable to unregister.
Returns
- bool
trueif the variable was registered before and is now unregistered,falseotherwise.
Remove(VariableDependency<TInstruction>)
public bool Remove(VariableDependency<TInstruction> item)
Parameters
itemVariableDependency<TInstruction>
Returns
TryGetDependency(IVariable, out VariableDependency<TInstruction>?)
Attempts to get the dependency assigned to the provided variable.
public bool TryGetDependency(IVariable variable, out VariableDependency<TInstruction>? dependency)
Parameters
variableIVariableThe variable.
dependencyVariableDependency<TInstruction>When this function returns
true, contains the dependency.
Returns
- bool
trueif the variable was registered as a dependency,falseotherwise.