This class provides a mechanism that can be used by clients to regulate the frequency at which actions can be taken. The data members of Throttle are currently public to allow for compile‐time (aggregate) initialization of Throttle objects having static storage duration (for C++03 compilers that do not provide constexpr).
Synopsis
Declared in <bdlmt_throttle.h>
class Throttle;
Member Functions
Name |
Description |
Return the system clock type with which this |
|
|
|
Return the maximum number of simultaneous actions for which this |
|
Return the time debt, in nanoseconds, that this |
|
Load into the specified |
|
|
|
|
Data Members
Name |
Description |
Clock type (monotonic or realtime) used by this throttle. |
|
Total bucket capacity expressed in actions. |
|
Nanoseconds consumed by each sustained action. |
|
Total bucket capacity expressed in nanoseconds. |
|
Effective time of the previous leak operation. |
Static Data Members
Name |
Description |
Ten years expressed in nanoseconds. |
Friends
Name |
Description |
[*PRIVATE*]This component private meta‐function is used to implement the initialization macros. This type provides the following: * Ensures arguments are evaluated at compile time (which won't be the case for floating point arguments) * Enables compile time checks with BSLMF_ASSERT * Handles special cases if 0 is passed for |
Created with MrDocs