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 |
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 |
|
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 |
|
Type Parameters
Name | Description |
---|---|
S | The simulation state type. |