/ fm / liveswitch / DataChannelStateMachine
Class: DataChannelStateMachine
fm.liveswitch.DataChannelStateMachine
A state machine for data channel states.
Hierarchy
- StateMachine<DataChannelState> - ↳ DataChannelStateMachine 
Table of contents
Constructors
Methods
- addTransition
- canTransition
- getLastStateMillis
- getLastStateTicks
- getPromise
- getState
- getStateValue
- getSystemTimestamp
- getTypeString
- isReachable
- stateToValue
- transition
- valueToState
Constructors
constructor
+ new DataChannelStateMachine(): DataChannelStateMachine
Initializes a new instance of the [[fm.liveswitch.dataChannelStateMachine]] class.
Returns: DataChannelStateMachine
Inherited from: StateMachine
Defined in: Generated/TypeScript/fm.liveswitch/DataChannelStateMachine.ts:12
Methods
addTransition
▸ addTransition(fromState: DataChannelState, toState: DataChannelState): void
Adds an allowed transition.
Parameters:
| Name | Type | Description | 
|---|---|---|
| fromState | DataChannelState | The "from" state. | 
| toState | DataChannelState | The "to" state. | 
Returns: void
Inherited from: StateMachine
Defined in: Generated/TypeScript/fm.liveswitch/StateMachine.ts:85
canTransition
▸ canTransition(toState: DataChannelState): boolean
Determines whether a transition to the specified state is allowed.
Parameters:
| Name | Type | Description | 
|---|---|---|
| toState | DataChannelState | The "to" state. | 
Returns: boolean
true if a transition to the specified state is allowed; otherwise, false.
Inherited from: StateMachine
Defined in: Generated/TypeScript/fm.liveswitch/StateMachine.ts:118
getLastStateMillis
▸ getLastStateMillis(): number
Gets the length of time spent in the last state, in milliseconds.
Returns: number
Inherited from: StateMachine
Defined in: Generated/TypeScript/fm.liveswitch/StateMachine.ts:183
getLastStateTicks
▸ getLastStateTicks(): number
Gets the length of time spent in the last state, in ticks.
Returns: number
Inherited from: StateMachine
Defined in: Generated/TypeScript/fm.liveswitch/StateMachine.ts:200
getPromise
▸ getPromise<R>(state: DataChannelState, returnValue: R): Promise<R>
Gets a promise, which may be resolved or rejected depending on the current state of this machine.
Type parameters:
| Name | Type | 
|---|---|
| R | Object | 
Parameters:
| Name | Type | Description | 
|---|---|---|
| state | DataChannelState | State, in which promise must be resolved. | 
| returnValue | R | Return type of this promise. | 
Returns: Promise<R>
Promise, which may be resolved or rejected depending on the current state of this machine
Inherited from: StateMachine
Defined in: Generated/TypeScript/fm.liveswitch/StateMachine.ts:215
getState
▸ getState(): DataChannelState
Gets the state.
Returns: DataChannelState
Inherited from: StateMachine
Defined in: Generated/TypeScript/fm.liveswitch/StateMachine.ts:238
getStateValue
▸ ProtectedgetStateValue(): number
Gets the state value.
Returns: number
Inherited from: StateMachine
Defined in: Generated/TypeScript/fm.liveswitch/StateMachine.ts:250
getSystemTimestamp
▸ getSystemTimestamp(): number
Gets the system timestamp of the last state transition.
Returns: number
Inherited from: StateMachine
Defined in: Generated/TypeScript/fm.liveswitch/StateMachine.ts:263
getTypeString
▸ getTypeString(): string
Returns: string
Overrides: StateMachine
Defined in: Generated/TypeScript/fm.liveswitch/DataChannelStateMachine.ts:10
isReachable
▸ isReachable(state: DataChannelState): boolean
Determines whether a transition to a specified state is possible (even via intermediate hops).
Parameters:
| Name | Type | Description | 
|---|---|---|
| state | DataChannelState | The "to" state. | 
Returns: boolean
true if a transition to the specified state is possible; otherwise, false.
Inherited from: StateMachine
Defined in: Generated/TypeScript/fm.liveswitch/StateMachine.ts:278
stateToValue
▸ ProtectedstateToValue(state: DataChannelState): number
Converts a state to an integer value.
Parameters:
| Name | Type | Description | 
|---|---|---|
| state | DataChannelState | The state. | 
Returns: number
Overrides: StateMachine
Defined in: Generated/TypeScript/fm.liveswitch/DataChannelStateMachine.ts:45
transition
▸ transition(toState: DataChannelState): boolean
Transitions to the specified state.
Parameters:
| Name | Type | Description | 
|---|---|---|
| toState | DataChannelState | The "to" state. | 
Returns: boolean
true if a transition to the specified state is allowed; otherwise, false.
Inherited from: StateMachine
Defined in: Generated/TypeScript/fm.liveswitch/StateMachine.ts:333
valueToState
▸ ProtectedvalueToState(value: number): DataChannelState
Converts an integer value to a state.
Parameters:
| Name | Type | Description | 
|---|---|---|
| value | number | The integer value. | 
Returns: DataChannelState
Overrides: StateMachine
Defined in: Generated/TypeScript/fm.liveswitch/DataChannelStateMachine.ts:58