|
infinite_state_machine 1.0.0
Infinite State Machine Library
|
Implementation of infinite state machine topology traversal. More...

Go to the source code of this file.
Functions | |
| struct infinite_state ** | infinite_state_topology (struct infinite_state *state, int depth, struct infinite_state **topology) |
| Get the topology of the infinite state machine. | |
Implementation of infinite state machine topology traversal.
The infinite_state_topology() function performs a depth-limited upward traversal of the state hierarchy, collecting unique super-states (including the starting state) into the supplied topology array. The function returns a pointer to the next free slot after the last written state. Duplicate suppression (to avoid loops) is compiled in only when DEBUG is defined.
Preconditions:
Postconditions:
Notes:
assert(depth>=0) for defensive programming. Definition in file infinite_state.c.
| struct infinite_state ** infinite_state_topology | ( | struct infinite_state * | state, |
| int | depth, | ||
| struct infinite_state ** | topology | ||
| ) |
Get the topology of the infinite state machine.
Compute a state's forward topological vector. This function fills the topology vector with the state's sub-states in "forward" order (from the outer state down to the inner). The function returns a pointer to the end of the filled vector.
This is a recursive implementation limited in depth.
| state | The current state. |
| depth | The current depth. |
| topology | The topology array to fill. |
Definition at line 32 of file infinite_state.c.