New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The State Machine implemented #92
The State Machine implemented #92
Conversation
State state(State state) { return m_state = state; } | ||
St status(BaseTaskPtr bt) const { return bt->getLastStatus(); } | ||
|
||
void process(BaseTaskPtr bt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need some logging here??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure. On one hand the messages would accompany others logging messages. On the other, they would be useful if we forgot to log such others, and they should be of special categorie, which we have no yet, to not overwhelm the log.
please make this PR vs. development/v0.0.2 |
include/state_machine.h
Outdated
|
||
for(auto& r : m_table) | ||
{ | ||
if(m_state != std::get<0>(r)) continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we avoid these magic numbers? I mean all these get.
Enum wouldn't be more clear?
}; | ||
} | ||
|
||
const StateMachine::Guard StateMachine::hasnt(Router::Handler H3::* act) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could it be just
return !has(act);
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. A lambda is returned. ! for lambda has different meaning.
No description provided.