Show / Hide Table of Contents

Interface IVariableFactory<V>

A template for a variable factory.

Namespace: SpiceSharp.Simulations
Assembly: SpiceSharp.dll
Syntax
public interface IVariableFactory<out V> where V : IVariable
Type Parameters
Name Description
V

The base variable type.

Methods

CreatePrivateVariable(string, IUnit)

Creates a variable that is private to whoever requested it. The factory will not shared this variable with anyone else, and the name is only used for display purposes.

Declaration
V CreatePrivateVariable(string name, IUnit unit)
Parameters
Type Name Description
string name

The name of the private variable.

IUnit unit

The unit of the variable.

Returns
Type Description
V

The private variable.

GetSharedVariable(string)

Gets a variable that can be shared with other behaviors by the factory. If another variable already exists with the same name, that is returned instead.

Declaration
V GetSharedVariable(string name)
Parameters
Type Name Description
string name

The name of the shared variable.

Returns
Type Description
V

The shared variable.

Exceptions
Type Condition
ArgumentNullException

Thrown if name is null.

Extension Methods

Utility.ThrowIfNull<T>(T, string)

See Also

IVariable
In this article
Back to top Generated by DocFX