|
i |
Automated Event ManagementProduce Finite State Machine CodeThe machine is derived from a list of states and transitions. Bit map managerCreate a header file that enumerates a bit mask and, optionally, a source file that will convert between strings and the bit masks. Construct a character classification table and a collection of macrosto test a character's classification. Config file editorCreate a program to edit a daemon config file by processing the options, rewriting the config file and sending SIGHUP to the daemon. Call a function based on an input nameThe input name is converted to an enumeration value and used as an index into a dispatch table. autofsm/fsm.tpl This template collection will produce a finite state machine based on a
description of such a machine. The presumption is that you generally
do not need to know what the current state is in order to determine what
kind of transition is to be taken. That is to say, there is a global
transition table that is indexed by the current state and the next
transition type to determine the next state and trigger any optional
transition handling code.
The finite state machine may be either the master, driving the other
parts of the program, or act as a subroutine keeping track of state
between calls. Consequently, the "type" attribute may be set to:
looping
If the machine processes transitions until it reaches a terminal
state (error or done).
stepping
If the FSM code will process a single transition and then return.
reentrant
This method is much the same as stepping, except that the caller
must save the current state and provide it on the next call.
In this fashion, an FSM may be used in a multi threaded application.
The machine can be constructed in either of three formats, depending
on the value of the "method" attribute:
callout
This method will use a callout table instead of a switch statement
to implement the machine.
case
This is the alternate implementation method.
none
Do not supply the "method" attribute. Choosing this will cause only
the dispatch table to be created. The implementation code is omitted.
The "type" attribute is then ignored.
Files generated by the autofsm add-on:example-fsm.c example-fsm.h Additional Files for autofsm:
autofsm/Makefile
autofsm/example.def
autofsm/fsm-macro.tpl
autofsm/fsm-trans.tpl
autofsm/run.sh
|