Main interface for the needs of a state function. More...
#include <stateMachine.hpp>
Public Member Functions | |
~FunIface () | |
void | freePkt () |
Free the packet after the batch is processed, do not send it. More... | |
Packet * | getPkt () |
Get an additional packet buffer. More... | |
void | transition (StateID newState) |
Transition to another state. More... | |
void | transitionNow (StateID newState) |
Immediately transition to another state. More... | |
void | setTimeout (std::chrono::milliseconds timeout, timeoutFun fun) |
Set a timeout, after which a transition will happen. More... | |
Friends | |
class | StateMachine< Identifier, Packet > |
Detailed Description
template<class Identifier, class Packet>
class StateMachine< Identifier, Packet >::FunIface
Main interface for the needs of a state function.
Definition at line 123 of file stateMachine.hpp.
Constructor & Destructor Documentation
◆ ~FunIface()
|
inline |
Member Function Documentation
◆ freePkt()
|
inline |
Free the packet after the batch is processed, do not send it.
Definition at line 181 of file stateMachine.hpp.
◆ getPkt()
|
inline |
Get an additional packet buffer.
- Returns
- The new packet buffer
Definition at line 187 of file stateMachine.hpp.
◆ setTimeout()
|
inline |
Set a timeout, after which a transition will happen.
- Parameters
-
timeout Time in milliseconds, until timeout will occur fun Function to execute, if timeout occurs
Definition at line 219 of file stateMachine.hpp.
◆ transition()
|
inline |
Transition to another state.
The new state will be used, as soon as the next packet for this connection is inbound.
- Parameters
-
newState The state to transition to
Definition at line 198 of file stateMachine.hpp.
◆ transitionNow()
|
inline |
Immediately transition to another state.
The new state will be called with the appropriate function, as soon as the current function returns. There is a check, if the endstate is reached. The new function call will receive the same packet as the function calling transitionNow().
- Parameters
-
newState The state to transition to
Definition at line 210 of file stateMachine.hpp.
Friends And Related Function Documentation
◆ StateMachine< Identifier, Packet >
|
friend |
Definition at line 125 of file stateMachine.hpp.
The documentation for this class was generated from the following file:
- /home/dominik/uni/MoonState/include/stateMachine.hpp