Return whether submitting one more unit would exceed capacity.
Synopsis
Declared in <balb_leakybucket.h>
bool
wouldOverflow(bsls::TimeInterval const& currentTime);
Description
Update the state of this this leaky bucket to the specified currentTime, and return true if adding 1 more unit to this leaky bucket would cause the total number of units held by this leaky bucket to exceed its capacity, and false otherwise. Note that this method counts both submitted units and reserved units toward the total number of units held by this leaky bucket. The behavior is undefined unless LLONG_MIN != currentTime.seconds() and the total number of seconds in the time interval resulting from currentTime ‐ lastUpdateTime() can be represented with a 64‐bit signed integer.
Return Value
true if adding 1 more unit would exceed capacity, and false otherwise
Parameters
Name |
Description |
currentTime |
time used to update this bucket before checking |
Created with MrDocs