SC.StateChart (sc v1.0.2)
View SourceRepresents a running state chart instance.
Contains the parsed document, current configuration, and separate queues for internal and external events as specified by the SCXML specification.
Summary
Functions
Get all currently active states including ancestors.
Remove and return the next event from internal queue (higher priority). Falls back to external queue if internal queue is empty.
Add an event to the appropriate queue based on its origin.
Check if there are any events in either queue.
Create a new state chart from a document with empty configuration.
Create a new state chart with a specific configuration.
Set the current event being processed.
Update the configuration of the state chart.
Update the data model of the state chart.
Types
@type t() :: %SC.StateChart{ configuration: SC.Configuration.t(), current_event: SC.Event.t() | nil, data_model: map(), document: SC.Document.t(), external_queue: [SC.Event.t()], internal_queue: [SC.Event.t()] }
Functions
Get all currently active states including ancestors.
@spec dequeue_event(t()) :: {SC.Event.t() | nil, t()}
Remove and return the next event from internal queue (higher priority). Falls back to external queue if internal queue is empty.
@spec enqueue_event(t(), SC.Event.t()) :: t()
Add an event to the appropriate queue based on its origin.
Check if there are any events in either queue.
@spec new(SC.Document.t()) :: t()
Create a new state chart from a document with empty configuration.
@spec new(SC.Document.t(), SC.Configuration.t()) :: t()
Create a new state chart with a specific configuration.
@spec set_current_event(t(), SC.Event.t() | nil) :: t()
Set the current event being processed.
@spec update_configuration(t(), SC.Configuration.t()) :: t()
Update the configuration of the state chart.
Update the data model of the state chart.