Hi Miro,
I am preparing a workshop for my colleagues, where I will go through the 5 design pattern, then I saw that from version 3.5 -> 4.0 the QHsm_getState function has been eliminated, why ?
Now the history pattern in 4.0 is not so nice any more, when one has to repeat setting the doorClosed_history in all the substates
/* start of 3.5 history pattern */
QState ToasterOven_doorClosed(ToasterOven *me, QEvent const *e) {
switch (e->sig) {
case Q_EXIT_SIG: {
/* store the deep history of this state */
me->doorClosed_history = QHsm_getState((QHsm *)me);
return (QState)0;
}
/* start of 4.0 history pattern */
case Q_ENTRY_SIG: {
printf("toasting;");
me->doorClosed_history = (QStateHandler)&ToasterOven_toasting;
return Q_HANDLED();
}
case Q_ENTRY_SIG: {
printf("baking;");
me->doorClosed_history = (QStateHandler)&ToasterOven_baking;
return Q_HANDLED();
}