RateWindow maintains a sliding window of second time buckets for the specified interval.
More...
#include <toolbox/net/RateLimit.hpp>
RateWindow maintains a sliding window of second time buckets for the specified interval.
Definition at line 60 of file RateLimit.hpp.
◆ RateWindow() [1/3]
toolbox::net::RateWindow::RateWindow |
( |
intervalT |
interval | ) |
|
|
inlineexplicit |
◆ ~RateWindow()
toolbox::net::RateWindow::~RateWindow |
( |
| ) |
|
|
default |
◆ RateWindow() [2/3]
◆ RateWindow() [3/3]
toolbox::net::RateWindow::RateWindow |
( |
RateWindow && |
| ) |
|
|
defaultnoexcept |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ count()
std::size_t toolbox::net::RateWindow::count |
( |
| ) |
const |
|
inlinenoexcept |
◆ add()
void toolbox::net::RateWindow::add |
( |
MonoTime |
time, |
|
|
std::size_t |
count = 1 |
|
) |
| |
|
noexcept |
Add count to time bucket. This function assumes a monotonically increasing clock.
Definition at line 54 of file RateLimit.cpp.
The documentation for this class was generated from the following files: