I am in the situation where I need to modify a state machine that I did not write. This state machine is written using Boost Statechart. Unfortunately, I find this code impenetrable, and the guy who did write it is on vacation.
The problem is simple, I think: I have a variable, thing
, that I want to use in some of these states. It represents a singular application controller that needs to be informed of things. To what constructor (or whatever) can I give thing
, making it available to states of the machine?
The states are declared as per this example:
struct Pumping : sc::state< Pumping, Purifier >
{
Pumping( my_context ctx ) : my_base( ctx )
{
post_event( EvPumpingStarted() );
}
// ...
};
P.S. I would love a better title for this question; help appreciated.