1 #ifndef GONG_APP_STATECONTROL_HPP_
2 #define GONG_APP_STATECONTROL_HPP_
10 class HeadlessApplication;
16 // add state to the front
21 // swap state at the front
22 void Switch(State *s) {
23 cue.emplace(SWITCH, s);
26 // remove state at the front
32 // application will exit if nothing is pushed after this
37 // pop states until this one is on top
38 void PopAfter(State *s) {
39 cue.emplace(POP_AFTER, s);
42 // pop states until this one is removed
43 void PopUntil(State *s) {
44 cue.emplace(POP_UNTIL, s);
48 void Commit(HeadlessApplication &);
62 explicit Memo(Command c, State *s = nullptr): state(s), cmd(c) { }