From: Andreas Huber (ah2003_at_[hidden])
Date: 2004-05-25 12:18:25


Hi Rob,

> Could the fsm manage a container of (pointers to) state objects
> that it populates as it first creates each state object and from
> which it retrieves a state object when transitioning? IOW, the
> first time the fsm encounters the need to transition to a given
> state (from A to B, say), it creates B and tracks it in the
> container. Upon transition back to A, the fsm locates state A in
> the container and reuses it.

This is certainly possible. I just have my doubts whether this approach is so
much better speed-wise. If you customize state memory management, construction
and destruction doesn't take an awful amount of cycles. Searching that state
container might well take longer for large FSMs.

Regards,

Andreas