MemVariables (fsm_diagram v0.1.0)

Copy Markdown View Source

to manage variable inside state machine.

This module provides functions to manage variables in a memory pool. It allows you to create, set, get, and remove variables associated with a specific FSM (Finite State Machine) identified by its module or name.

Summary

Functions

Creates a variable storage for the specified FSM.

Types

fsm_id()

@type fsm_id() :: module() | String.t()

Functions

create_var(mod)

@spec create_var(fsm_id() | String.t()) :: boolean()

Creates a variable storage for the specified FSM.

get_var(mod, name)

@spec get_var(fsm_id(), atom()) :: any() | nil

remove_var(mod)

@spec remove_var(fsm_id()) :: boolean()

set_var(mod, name, var)

@spec set_var(fsm_id(), atom(), any()) :: boolean()