Question

For some reasons, I can't setup the parameter of the state machine by constructor So I would like to access the public member function of the meta state machine by the back end. That is, I want something like

typedef msm::back::state_machine<player_> player;

player p;
p.get_front_end(); //get the address of the front end
p.get_front_end().set_param(34) //call the member function of front end

Is this possible?Thanks

The other solution is pass the parameter into the state machine by Event.

p.process_event(open_theme(34));
Was it helpful?

Solution

The back-end inherits the front-end, so you can call set_param directly on p.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top