infinite_state_machine 1.0.0
Infinite State Machine Library
Loading...
Searching...
No Matches
Classes | Functions
infinite_state.h File Reference

Core definitions for the infinite (unbounded topology and depth albeit limited by memory resources) hierarchical state machine. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  infinite_state
 The state structure for the infinite state. This structure represents a state in the infinite state machine. It contains information about the state's parent, composite enter action, and composite exit action. More...
 

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.
 

Detailed Description

Core definitions for the infinite (unbounded topology and depth albeit limited by memory resources) hierarchical state machine.

Declares the infinite_state structure (a node in a singly-linked ancestry chain via its super pointer) and a helper to build a forward topology (outer to inner). The enter and exit callbacks are optional (being NULL if unused) and are invoked after push (enter) and after final removal (exit) respectively.

Definition in file infinite_state.h.

Function Documentation

◆ infinite_state_topology()

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.

Parameters
stateThe current state.
depthThe current depth.
topologyThe topology array to fill.
Returns
The updated topology array.

Definition at line 32 of file infinite_state.c.