FsmDiagram.Fsmlib (fsm_diagram v0.1.0)

Copy Markdown View Source

libraries Fsm are using to handle FsmDiagram

Summary

Functions

get list of all fsm_id

get element data from data :func - function of fsm :argv - argument :vars - variable fsmid owns

get fsm record {fsmid, func, argv, vars} from :ets

get pid of fsm process from fsm_id through Registry fsmid: module or name of starting process

put vars into vars data of {fsmid, func, argv, vars} vars data is any() but one the variables are stored as list of tuple [{var1,

get fsm_id from self() through Registry

update State machine function and the arguement func(): Module and function such as &Module.func/1 func.(any()) executes, so append Module. the arity of func is fixed one but any()

Types

fsm_id()

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

Functions

fsm_table()

@spec fsm_table() :: list()

get list of all fsm_id

get_elm(kind)

@spec get_elm(atom()) :: term()

get element data from data :func - function of fsm :argv - argument :vars - variable fsmid owns

get_elm(fsm_id, kind)

get_fsm()

@spec get_fsm() :: tuple() | nil

get fsm record {fsmid, func, argv, vars} from :ets

get_fsm(fsm_id)

get_fsmpid(fsmid)

@spec get_fsmpid(any()) :: pid() | nil

get pid of fsm process from fsm_id through Registry fsmid: module or name of starting process

put_vars(vars)

@spec put_vars(any()) :: none()

put vars into vars data of {fsmid, func, argv, vars} vars data is any() but one the variables are stored as list of tuple [{var1,

put_vars(fsm_id, vars)

self_fsmid()

@spec self_fsmid() :: {:ok, fsm_id()} | {:error, any()}

get fsm_id from self() through Registry

update_fnc(func, argv)

@spec update_fnc(fun(), any()) :: any()

update State machine function and the arguement func(): Module and function such as &Module.func/1 func.(any()) executes, so append Module. the arity of func is fixed one but any()

update_fnc(fsm_id, func, argv)

@spec update_fnc(any(), fun(), any()) :: any()