Specialization for void, which doesn't store a value.
More...
#include <throttle.hpp>
|
| | Throttle ()=default |
| | Throttle (const std::chrono::milliseconds interval) |
| | Constructs the throttle with the given interval.
|
| void | set_interval (const std::chrono::milliseconds interval) |
| bool | update () |
| | Updates the value and if the interval has passed since the last update returns the new value.
|
| std::optional< void > | get () |
| std::optional< void > | get_throttled () |
| void | clear () |
| | Clears the stored value.
|
Specialization for void, which doesn't store a value.
Definition at line 103 of file throttle.hpp.
◆ Throttle() [1/2]
◆ Throttle() [2/2]
| rav::Throttle< void >::Throttle |
( |
const std::chrono::milliseconds | interval | ) |
|
|
inlineexplicit |
Constructs the throttle with the given interval.
- Parameters
-
| interval | The interval to throttle the value to. |
Definition at line 111 of file throttle.hpp.
◆ clear()
◆ get()
- Returns
- The value, which might be empty if no value was set before.
Definition at line 67 of file throttle.hpp.
◆ get_throttled()
- Returns
- The value if the interval has passed since the last update, otherwise an empty optional. The last set value will be returned, even if the value wasn't changed since the last call to update.
Definition at line 75 of file throttle.hpp.
◆ set_interval()
| void rav::Throttle< void >::set_interval |
( |
const std::chrono::milliseconds | interval | ) |
|
|
inline |
- Parameters
-
| interval | The interval to throttle the value to. |
Definition at line 116 of file throttle.hpp.
◆ update()
Updates the value and if the interval has passed since the last update returns the new value.
If the value is equal to the current value, nothing will happen and the function will return an empty optional.
- Returns
- The value if changed and the interval was passed, otherwise an empty optional.
Definition at line 125 of file throttle.hpp.
The documentation for this class was generated from the following file: