
There is no singleton in the proposed solution. The proposed solution merely hides MSM guts from public headers to reduce compile time (pimpl idiom). Nothing is stopping you from creating multiple instances of PublicClass.
Exact.
I think shared_ptr is causing the confusion - it is merely an implementation detail, data it points to is not intended to be shared between different PublicClass objects. You could also have use a plain pointer (but then you need to consider copy semantics), or scoped_ptr (which would make this class non-copyable).
It's just safer than a pointer, which I avoid giving as example ;-) and easier to use than a scoped_ptr. Juraj is right, all these ways are correct. Only plain values or references would not help you as they'd force all the template instantiations into every TU including your header. Furthermore, it's considered bad style to give access to the internals of your fsm, populate instead PublicClass with public members processing events in the .cpp file. Thanks, Christophe