[FSM] Saving/Restoring the state_machine
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? Best regards, Emil Mieilica
spooky@go.ro 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.
participants (2)
-
Andreas Huber
-
spooky@go.ro