Boost logo

Boost Users :

From: Andreas Huber (ahd6974-spamgroupstrap_at_[hidden])
Date: 2004-10-25 17:42:16


spooky_at_[hidden] wrote:
> Is it possible to save the current state of the state machine to a
> stream or by means of boost::serialize?
>
> Details:
> I am building a state machine using boost::fsm that is trying to
> follow the activity of items in a processing pipeline.
> I am trying to implement a procedure that allows the software to be
> turned off and on again without loosing the information about the
> current state. Naturally, I want to have a timer and, at some
> interval I checkpoint the state machine and save the binary
> representation to a file. The contents of the file are used during
> application startup to restore the state machine. Can I achieve this
> functionality with boost::fsm?

No, not at the moment. I'd thought about this when I started to design
the library but have never had the time to seriously consider it. It has
never been requested before.
boost::fsm is going to be reviewed soon and given the little time that
remains I'm afraid I won't be able to implement this before the review
(not yet fixed but probably late January). I'll have a look and try to
estimate how much work it will be.

FWIW, the library currently stores history in a way that is
fundamentally incompatible with serialization (function pointers), so
history would very likely be excluded in the beginning.

In the mean time, you might be able to pull some tricks if your machine
is simple. How many states does your machine have? Does it have
orthogonal regions? Does it use history?

Regards,

-- 
Andreas Huber
When replying by private email, please remove the words spam and trap
from the address shown in the header. 

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net