Table of Contents

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

TInstruction

The type of instruction to put in each node.

Inheritance
VariableDependencyCollection<TInstruction>
Implements
Inherited Members

Properties

Count

public int Count { get; }

Property Value

int

EdgeCount

Gets the total number of edges that are stored in this dependency collection.

public int EdgeCount { get; }

Property Value

int

IsReadOnly

public bool IsReadOnly { get; }

Property Value

bool

this[IVariable]

Gets or sets the variable dependency assigned to the variable.

public VariableDependency<TInstruction> this[IVariable variable] { get; set; }

Parameters

variable IVariable

The variable

Property Value

VariableDependency<TInstruction>

Methods

Add(VariableDependency<TInstruction>)

Adds a variable dependency to the node.

public void Add(VariableDependency<TInstruction> dependency)

Parameters

dependency VariableDependency<TInstruction>

The dependency to add.

Clear()

public void Clear()

Contains(VariableDependency<TInstruction>)

public bool Contains(VariableDependency<TInstruction> item)

Parameters

item VariableDependency<TInstruction>

Returns

bool

ContainsVariable(IVariable)

Determines whether the provided variable is registered as a dependency.

public bool ContainsVariable(IVariable variable)

Parameters

variable IVariable

The dependency.

Returns

bool

CopyTo(VariableDependency<TInstruction>[], int)

public void CopyTo(VariableDependency<TInstruction>[] array, int arrayIndex)

Parameters

array VariableDependency<TInstruction>[]
arrayIndex int

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

variable IVariable

The variable to unregister.

Returns

bool

true if the variable was registered before and is now unregistered, false otherwise.

Remove(VariableDependency<TInstruction>)

public bool Remove(VariableDependency<TInstruction> item)

Parameters

item VariableDependency<TInstruction>

Returns

bool

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

variable IVariable

The variable.

dependency VariableDependency<TInstruction>

When this function returns true, contains the dependency.

Returns

bool

true if the variable was registered as a dependency, false otherwise.