Hi,
I'm using msm to store the state of many small objects. Each one is around
24 bytes on its own. However, I just found out from experimentation that a
MSM state machine takes many bytes to store. For the following program, the
print out is:
entering: State1
104
48
This indicates that the very simple one-state, no-transition, machine is
104 bytes, and takes 48 bytes even to serialized. The
front::state_machine_def, however, is only 1 byte, though I suspect thet
real state is stored only in the 104-byte back::state_machine.
Even the SimpleTutorial.cpp example, when I adapt it to print the size,
shows 128 bytes.
Theoretically, all this information take no more than a few bits to store,
and one byte is generous. What's the internal representation of a state
machine and how can I optimize the size of the representation? This matters
for my use case because I have many small objects for which I want to
maintain state, that are only ~20 bytes each. I thought perhaps I could
mitigate this size problem by storing the serialized bytes but even the
serialized bytes are many.
I'm using boost 1.51 and gcc 4.7.2 on 64-bit Linux.
Josh
#include <iostream>
#include <strstream>
#include