Information of time_limit for a state.
More...
Information of time_limit for a state.
Definition at line 198 of file agent.cpp.
◆ msg_timeout
Type of signal to be used for controlling timeouts.
Definition at line 202 of file agent.cpp.
◆ steady_clock
Type of clock to be used.
Definition at line 205 of file agent.cpp.
◆ time_limit_t()
| so_5::state_t::time_limit_t::time_limit_t |
( |
duration_t | limit, |
|
|
const state_t & | state_to_switch ) |
|
inlinenoexcept |
Initializing constructor.
- Parameters
-
| limit | Value of the time limit. |
| state_to_switch | The target state to switch to after the time limit has been exceeded. |
Definition at line 208 of file agent.cpp.
◆ activate()
Sends the delayed msg_timeout signal.
Updates the value of m_activation_data.
It's assumed that this method will be called only if time_limit is not active yet.
Definition at line 268 of file agent.cpp.
◆ change()
| void so_5::state_t::time_limit_t::change |
( |
duration_t | limit, |
|
|
const state_t & | state_to_switch ) |
|
inlinenoexcept |
Change parameters of time limit.
- Note
- This method only changes m_limit and m_state_to_switch but doesn't change m_activation_data. If time_limit is activated it has to be deactivated explicitly via deactivate() method.
Definition at line 224 of file agent.cpp.
◆ deactivate()
| void so_5::state_t::time_limit_t::deactivate |
( |
| ) |
|
|
inline |
Deactivates the time limit.
This method can be called even if the time limit is not active.
Resets the value of m_activation_data and cancels the delayed msg_timeout signal.
Definition at line 287 of file agent.cpp.
◆ is_limit_exceeded()
| bool so_5::state_t::time_limit_t::is_limit_exceeded |
( |
const steady_clock::time_point | current_time | ) |
const |
|
inlinenodiscardnoexcept |
- Return values
-
| true | if timeout has been exceeded and the agent has to be switched to a new state. |
| false | if timeout has not been exceeded yet (or if time limit isn't activated). |
Definition at line 300 of file agent.cpp.
◆ on_state_activation()
React to activation of the state for that time_limit is defined.
Sends delayed msg_timeout message and sets the m_activation_data.
- Attention
- This method is marked as noexcept because it has to be called in a noexcept context. But it calls methods those can throw (like so_5::send_periodic). This is a consequence of the current design of SObjectizer-5 (there is no non-throwing ways to send a message yet).
Definition at line 243 of file agent.cpp.
◆ on_state_deactivation()
| void so_5::state_t::time_limit_t::on_state_deactivation |
( |
| ) |
|
|
inlinenoexcept |
React to deactivation of the state for that time_limit is defined.
Resets the value of m_activation_data and cancels the delayed msg_timeout message.
Definition at line 254 of file agent.cpp.
◆ state_to_switch()
| const state_t & so_5::state_t::time_limit_t::state_to_switch |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
- Returns
- Reference to the state to switch after expiration of the timeout.
Definition at line 314 of file agent.cpp.
◆ m_activation_data
Information required to serve timeout when it's activated.
Empty value means that the timeout isn't activated.
Definition at line 355 of file agent.cpp.
◆ m_limit
◆ m_state_to_switch
| std::reference_wrapper< const state_t > so_5::state_t::time_limit_t::m_state_to_switch |
|
private |
The target state to switch after the timeout.
Definition at line 350 of file agent.cpp.
The documentation for this class was generated from the following file: