Show / Hide Table of Contents

Interface IStateful

An interface describing a class that can contain states.

Namespace: SpiceSharp.Simulations
Assembly: SpiceSharp.dll
Syntax
public interface IStateful

Properties

States

Gets all the states that the class uses.

Declaration
IEnumerable<Type> States { get; }
Property Value
Type Description
IEnumerable<Type>

The states.

Methods

GetState<S>()

Gets the state of the specified type.

Declaration
S GetState<S>() where S : ISimulationState
Returns
Type Description
S

The type, or null if the state isn't used.

Type Parameters
Name Description
S

The simulation state type.

Exceptions
Type Condition
TypeNotFoundException

Thrown if the simulation state is not defined on this instance.

TryGetState<S>(out S)

Tries to get a state of the specified type.

Declaration
bool TryGetState<S>(out S state) where S : ISimulationState
Parameters
Type Name Description
S state

The state.

Returns
Type Description
bool

true if the state exists; otherwise false.

Type Parameters
Name Description
S

The simulation state type.

UsesState<S>()

Checks if the class uses the specified state.

Declaration
bool UsesState<S>() where S : ISimulationState
Returns
Type Description
bool

true if the class uses the state; otherwise false.

Type Parameters
Name Description
S

The simulation state type.

Extension Methods

Utility.ThrowIfNull<T>(T, string)
In this article
Back to top Generated by DocFX