|
|
|
@ -56,31 +56,31 @@ class Builder : DeadSimpleFSM<BuildState, BuildEvent> { |
|
|
|
|
void event(BuildEvent ev) { |
|
|
|
|
try { |
|
|
|
|
if(ev == QUIT) { |
|
|
|
|
exit(ev); |
|
|
|
|
EXIT(ev); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
switch(_state) { |
|
|
|
|
FSM_STATE(BuildState, BUILDING, building, ev); |
|
|
|
|
FSM_STATE(BuildState, START, start, ev); |
|
|
|
|
FSM_STATE(BuildState, WAITING, waiting, ev); |
|
|
|
|
FSM_STATE(BuildState, DONE, done, ev); |
|
|
|
|
FSM_STATE(BuildState, FORKING, forking, ev); |
|
|
|
|
FSM_STATE(BuildState, READING, reading, ev); |
|
|
|
|
FSM_STATE(BuildState, EXIT, exit, ev); |
|
|
|
|
FSM_STATE(BuildState, ERROR, exit, ev); |
|
|
|
|
FSM_STATE(BuildState, BUILDING, ev); |
|
|
|
|
FSM_STATE(BuildState, START, ev); |
|
|
|
|
FSM_STATE(BuildState, WAITING, ev); |
|
|
|
|
FSM_STATE(BuildState, DONE, ev); |
|
|
|
|
FSM_STATE(BuildState, FORKING, ev); |
|
|
|
|
FSM_STATE(BuildState, READING, ev); |
|
|
|
|
FSM_STATE(BuildState, EXIT, ev); |
|
|
|
|
FSM_STATE(BuildState, ERROR, ev); |
|
|
|
|
} |
|
|
|
|
} catch(...) { |
|
|
|
|
fmt::println("ERROR: unhandled state: {}", int(_state)); |
|
|
|
|
error(ev); |
|
|
|
|
ERROR(ev); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void building(BuildEvent ev); |
|
|
|
|
void start(BuildEvent ev); |
|
|
|
|
void waiting(BuildEvent ev); |
|
|
|
|
void done(BuildEvent ev); |
|
|
|
|
void forking(BuildEvent ev); |
|
|
|
|
void reading(BuildEvent ev); |
|
|
|
|
void error(BuildEvent ev); |
|
|
|
|
void exit(BuildEvent ev); |
|
|
|
|
void BUILDING(BuildEvent ev); |
|
|
|
|
void START(BuildEvent ev); |
|
|
|
|
void WAITING(BuildEvent ev); |
|
|
|
|
void DONE(BuildEvent ev); |
|
|
|
|
void FORKING(BuildEvent ev); |
|
|
|
|
void READING(BuildEvent ev); |
|
|
|
|
void ERROR(BuildEvent ev); |
|
|
|
|
void EXIT(BuildEvent ev); |
|
|
|
|
}; |
|
|
|
|