Boost logo

Boost Users :

Subject: Re: [Boost-users] MSM & serialization
From: Christophe Henry (christophe.j.henry_at_[hidden])
Date: 2010-09-13 17:54:21


>>> I'm planing to use the new MetaStateMachine library for a game. But i
>>> want to create savegames with boost::serialization so i would need to
>>> serialize the state machine.
>>> There shouln't be too much to safe (the current state basically), but I
>>> can't see how I can do this.
>>> So, how can I do this?
>>
>> Hi,
>>
>> For the moment, unfortunately not at all, though it is something I
>> want to do since a while and pretty high on my internal priority
>> queue.
>> How urgently do you need it?
>> In the worst case, it would be easy to temporarily add a setter for
>> the current state (we have a getter).
>>
>> Regards,
>> Christophe
>
> Hi,
> for the current project i just need 2 small state machines, so i can
> hardcode them. But in the future it would really like to use MSM, at
> thats impossible for me as long as i can't safe them.
> So it's not very urgent, but if i could use it in 2 month, it would be
> great.

Hi,

No, it won't be said so easily that MSM forces its users to hardcode
state machines ;-)
I just put something together and committed (without guarantee ;-) )
into the trunk.
I also added into libs/msm/doc/HTML an example (Serialize.cpp) where
you can serialize a state machine and even optionally states
themselves (using a do_serialize typedef).
It's not tested thoroughly in the little time I spent on it tonight
and there are a few things I need to think about more but I hope it'll
help you.
Please keep me informed about your experience with this brand new feature ;-)

Regards,

Christophe


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