class State extends Area with ScalaLocated
Represents a state within a state machine.
States can define behaviors for entry, exit, and active phases using methods like onEntry, onExit, and whenIsActive.
val fsm = new StateMachine { val stateA: State = new State with EntryPoint { onEntry { counter := 0 } whenIsActive { counter := counter + 1 when(counter === 4) { goto(stateB) } } onExit { io.result := True } } val stateB: State = new State { whenIsActive { goto(stateA) } } }
- Alphabetic
- By Inheritance
- State
- Area
- OverridedEqualsHashCode
- ValCallbackRec
- ValCallback
- NameableByComponent
- Nameable
- ContextUser
- ScalaLocated
- GlobalDataUser
- OwnableRef
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new State()(implicit stateMachineAccessor: StateMachineAccessor)
Type Members
-
abstract
type
RefOwnerType
- Definition Classes
- OwnableRef
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
val
_context: Capture
- Definition Classes
- Area
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
childNamePriority: Byte
- Definition Classes
- Area
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @IntrinsicCandidate()
-
def
component: Component
- Definition Classes
- ContextUser
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(obj: Any): Boolean
- Definition Classes
- OverridedEqualsHashCode → AnyRef → Any
-
def
exit(): Unit
Schedules the state machine to be in the boot state the next cycle (or, in StateFsm, to exit the current nested state machine).
-
def
foreachReflectableNameables(doThat: (Any) ⇒ Unit): Unit
- Definition Classes
- Nameable
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
-
def
getDisplayName(): String
- Definition Classes
- Nameable
-
def
getInstanceCounter: Int
- Definition Classes
- ContextUser
-
def
getMode: Byte
- Attributes
- protected
- Definition Classes
- Nameable
-
def
getName(default: String): String
- Definition Classes
- NameableByComponent → Nameable
-
def
getName(): String
- Definition Classes
- NameableByComponent → Nameable
-
def
getPartialName(): String
- Definition Classes
- Nameable
-
def
getPath(from: Component, to: Component): Seq[Component]
- Definition Classes
- NameableByComponent
-
def
getRefOwnersChain(): List[Any]
- Definition Classes
- OwnableRef
-
def
getScalaLocationLong: String
- Definition Classes
- ScalaLocated
-
def
getScalaLocationShort: String
- Definition Classes
- ScalaLocated
-
def
getScalaTrace(): Throwable
- Definition Classes
- ScalaLocated
-
def
getStateMachineAccessor(): StateMachineAccessor
Used internally by the state machine library
-
val
globalData: GlobalData
- Definition Classes
- GlobalDataUser
-
def
goto(state: State): Unit
Schedules the state machine to be in the provided State the next cycle.
-
def
hashCode(): Int
- Definition Classes
- OverridedEqualsHashCode → AnyRef → Any
-
def
innerFsm(that: ⇒ StateMachine): Unit
Internal to the state machine library
- var innerFsm: ArrayBuffer[StateMachine]
-
def
isCompletelyUnnamed: Boolean
- Definition Classes
- Nameable
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
isNamed: Boolean
- Definition Classes
- Nameable
-
def
isPriorityApplicable(namePriority: Byte): Boolean
- Definition Classes
- Nameable
-
def
isUnnamed: Boolean
- Definition Classes
- NameableByComponent → Nameable
-
val
name: String
- Definition Classes
- Nameable
- val nameableRef: Nameable
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
-
def
onEntry(doThat: ⇒ Unit): State.this.type
Defines statements to apply when the state machine is not in this state but will be in it during the next cycle.
Defines statements to apply when the state machine is not in this state but will be in it during the next cycle.
- doThat
hardware statement(s)
val stateA: State = new State with EntryPoint { onEntry { counter := 0 io.led := True } whenIsActive { goto(stateB) } }
Example: - val onEntryTasks: ArrayBuffer[() ⇒ Unit]
-
def
onExit(doThat: ⇒ Unit): State.this.type
Defines statements applied when the state machine is in this state and will be in another state the next cycle.
Defines statements applied when the state machine is in this state and will be in another state the next cycle.
- doThat
Hardware statement(s)
val stateA: State = new State with EntryPoint { whenIsActive { goto(stateB) } onExit { io.result := True io.led := False } }
Example: - val onExitTasks: ArrayBuffer[() ⇒ Unit]
-
def
overrideLocalName(name: String): State.this.type
- Definition Classes
- Nameable
-
val
parentScope: ScopeStatement
- Definition Classes
- ContextUser
-
val
refOwner: RefOwnerType
- Definition Classes
- OwnableRef
- Annotations
- @DontName()
-
def
reflectNames(): Unit
- Definition Classes
- Nameable
-
def
rework[T](body: ⇒ T): T
- Definition Classes
- Area
-
val
scalaTrace: Throwable
- Definition Classes
- ScalaLocated
-
def
setCompositeName(nameable: Nameable, postfix: String, namePriority: Byte): State.this.type
- Definition Classes
- Nameable
-
def
setCompositeName(nameable: Nameable, postfix: String, weak: Boolean): State.this.type
- Definition Classes
- Nameable
-
def
setCompositeName(nameable: Nameable, postfix: String): State.this.type
- Definition Classes
- Nameable
-
def
setCompositeName(nameable: Nameable, namePriority: Byte): State.this.type
- Definition Classes
- Nameable
-
def
setCompositeName(nameable: Nameable, weak: Boolean): State.this.type
- Definition Classes
- Nameable
-
def
setCompositeName(nameable: Nameable): State.this.type
- Definition Classes
- Nameable
-
def
setLambdaName(isNameBody: ⇒ Boolean)(nameGen: ⇒ String): State.this.type
- Definition Classes
- Nameable
-
def
setName(name: String, namePriority: Byte): State.this.type
- Definition Classes
- Nameable
-
def
setName(name: String, weak: Boolean): State.this.type
- Definition Classes
- Nameable
-
def
setName(name: String): State.this.type
- Definition Classes
- Nameable
-
def
setNameAsWeak(): State.this.type
- Definition Classes
- Nameable
-
def
setPartialName(name: String, namePriority: Byte, owner: Any): State.this.type
- Definition Classes
- Nameable
-
def
setPartialName(name: String, namePriority: Byte): State.this.type
- Definition Classes
- Nameable
-
def
setPartialName(name: String, weak: Boolean): State.this.type
- Definition Classes
- Nameable
-
def
setPartialName(owner: Nameable, name: String, namePriority: Byte): State.this.type
- Definition Classes
- Nameable
-
def
setPartialName(owner: Nameable, name: String, weak: Boolean): State.this.type
- Definition Classes
- Nameable
-
def
setPartialName(name: String): State.this.type
- Definition Classes
- Nameable
-
def
setPartialName(owner: Nameable, name: String): State.this.type
- Definition Classes
- Nameable
-
def
setPartialName(owner: Nameable): State.this.type
- Definition Classes
- Nameable
-
def
setRefOwner(that: Any): Unit
- Definition Classes
- OwnableRef
-
def
setScalaLocated(source: ScalaLocated): State.this.type
- Definition Classes
- ScalaLocated
-
def
setWeakName(name: String): State.this.type
- Definition Classes
- Nameable
- val stateId: Int
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- def toString(): String
-
def
unsetName(): State.this.type
- Definition Classes
- Nameable
-
def
valCallback[T](ref: T, name: String): T
- Definition Classes
- ValCallbackRec → ValCallback
-
def
valCallbackOn(ref: Any, name: String, refs: Set[Any]): Unit
- Definition Classes
- ValCallbackRec
-
def
valCallbackRec(obj: Any, name: String): Unit
- Definition Classes
- Area → ValCallbackRec
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- val whenActiveTasks: ArrayBuffer[StateMachineTask]
- val whenInactiveTasks: ArrayBuffer[() ⇒ Unit]
-
def
whenIsActive(doThat: ⇒ Unit): State.this.type
Defines statements applied when the state machine is in this state.
Defines statements applied when the state machine is in this state.
- doThat
hardware statement(s)
val stateA: State = new State with EntryPoint { whenIsActive { counter := counter + 1 when(counter === 10) { goto(stateB) } } }
Example: -
def
whenIsActiveWithPriority(priority: Int)(doThat: ⇒ Unit): State.this.type
Used internally by the state machine library
Used internally by the state machine library
- See also
#whenIsActive()
-
def
whenIsInactive(doThat: ⇒ Unit): State.this.type
Defines statements applied when the state machine is not in this state.
Defines statements applied when the state machine is not in this state.
- doThat
hardware statement(s)
-
def
whenIsNext(doThat: ⇒ Unit): State.this.type
Defines statements applied when the state machine will be in state the next cycle (even if it is already in it).
- val whenIsNextTasks: ArrayBuffer[() ⇒ Unit]
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated