qpcpp/doxygen/snippets/qf_subscribe.cpp
Quantum Leaps 890c8e7d8c 5.1.1
2013-10-10 20:01:51 -04:00

12 lines
376 B
C++

QState Table::initial(Table * const me, QEvt const *) {
uint8_t n;
me->subscribe(HUNGRY_SIG); // subscribe to HUNGRY
me->subscribe(DONE_SIG); // subscribe to DONE
me->subscribe(TERMINATE_SIG); // subscribe to TERMINATE
for (n = 0; n < N; ++n) {
me->fork_[n] = FREE;
me->isHungry_[n] = 0;
}
return Q_TRAN(&Table::serving);
}