qpcpp/doxygen/snippets/qf_subscribe.cpp
MMS 34cdcc7929 7.0.0rc1
major release 7.0.0 release candidate 1
2022-04-19 19:23:30 -04:00

13 lines
342 B
C++

Q_State_DEF(Table, initial) {
subscribe(HUNGRY_SIG); // <--- subscribe to HUNGRY
subscribe(DONE_SIG); // <--- subscribe to DONE
subscribe(TERMINATE_SIG); // <--- subscribe to TERMINATE
for (std::uint8_t n = 0U; n < N; ++n) {
m_fork_[n] = FREE;
m_isHungry_[n] = 0U;
}
return tran(&serving);
}