BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdlmt_throttle.h File Reference
#include <bsls_ident.h>
#include <bdlscm_version.h>
#include <bdlt_timeunitratio.h>
#include <bslmf_assert.h>
#include <bslmf_integralconstant.h>
#include <bsls_atomicoperations.h>
#include <bsls_libraryfeatures.h>
#include <bsls_systemclocktype.h>
#include <bsls_systemtime.h>
#include <bsls_timeinterval.h>
#include <bsls_types.h>
#include <bsl_chrono.h>
#include <bsl_climits.h>

Go to the source code of this file.

Classes

class  bdlmt::Throttle
 
class  bdlmt::Throttle_InitHelper< t_MAX_SIMULTANEOUS_ACTIONS, t_NANOSECONDS_PER_ACTION >
 

Macros

#define BDLMT_THROTTLE_INIT(maxSimultaneousActions, nanosecondsPerAction)
 
#define BDLMT_THROTTLE_INIT_REALTIME(maxSimultaneousActions, nanosecondsPerAction)
 
#define BDLMT_THROTTLE_INIT_ALLOW_ALL   BDLMT_THROTTLE_INIT(1, 0)
 
#define BDLMT_THROTTLE_INIT_ALLOW_NONE   BDLMT_THROTTLE_INIT(0, 1)
 
#define BDLMT_THROTTLE_IF(maxSimultaneousActions, nanosecondsPerAction)
 
#define BDLMT_THROTTLE_IF_REALTIME(maxSimultaneousActions, nanosecondsPerAction)
 
#define BDLMT_THROTTLE_IF_ALLOW_ALL   BDLMT_THROTTLE_IF(1, 0)
 
#define BDLMT_THROTTLE_IF_ALLOW_NONE   BDLMT_THROTTLE_IF(0, 1)
 

Detailed Description

The content of this file has been pre-processed for Doxygen.

Macro Definition Documentation

◆ BDLMT_THROTTLE_IF

#define BDLMT_THROTTLE_IF (   maxSimultaneousActions,
  nanosecondsPerAction 
)
Value:
if (bool bdlmt_throttle_iFsToP = false) {} \
else \
for (static BloombergLP::bdlmt::Throttle bdlmt_throttle_iFtHrOtTlE = \
BDLMT_THROTTLE_INIT((maxSimultaneousActions), \
(nanosecondsPerAction)); \
!bdlmt_throttle_iFsToP; \
bdlmt_throttle_iFsToP = true) \
if (bdlmt_throttle_iFtHrOtTlE.requestPermission())
#define BDLMT_THROTTLE_INIT(maxSimultaneousActions, nanosecondsPerAction)
Definition bdlmt_throttle.h:620

◆ BDLMT_THROTTLE_IF_ALLOW_ALL

#define BDLMT_THROTTLE_IF_ALLOW_ALL   BDLMT_THROTTLE_IF(1, 0)

◆ BDLMT_THROTTLE_IF_ALLOW_NONE

#define BDLMT_THROTTLE_IF_ALLOW_NONE   BDLMT_THROTTLE_IF(0, 1)

◆ BDLMT_THROTTLE_IF_REALTIME

#define BDLMT_THROTTLE_IF_REALTIME (   maxSimultaneousActions,
  nanosecondsPerAction 
)
Value:
if (bool bdlmt_throttle_iFsToP = false) {} \
else \
for (static BloombergLP::bdlmt::Throttle bdlmt_throttle_iFtHrOtTlE = \
BDLMT_THROTTLE_INIT_REALTIME((maxSimultaneousActions), \
(nanosecondsPerAction)); \
!bdlmt_throttle_iFsToP; \
bdlmt_throttle_iFsToP = true) \
if (bdlmt_throttle_iFtHrOtTlE.requestPermission())
#define BDLMT_THROTTLE_INIT_REALTIME(maxSimultaneousActions, nanosecondsPerAction)
Definition bdlmt_throttle.h:634

◆ BDLMT_THROTTLE_INIT

#define BDLMT_THROTTLE_INIT (   maxSimultaneousActions,
  nanosecondsPerAction 
)
Value:
{ \
{ -BloombergLP::bdlmt::Throttle::k_TEN_YEARS_NANOSECONDS }, \
BloombergLP::bdlmt::Throttle_InitHelper< \
(maxSimultaneousActions), \
(nanosecondsPerAction)>::k_npaValue, \
bsl::integral_constant<BloombergLP::bsls::Types::Int64, \
1LL * (maxSimultaneousActions) * (nanosecondsPerAction)>::value, \
BloombergLP::bdlmt::Throttle_InitHelper< \
(maxSimultaneousActions), \
(nanosecondsPerAction)>::k_msaValue, \
BloombergLP::bsls::SystemClockType::e_MONOTONIC \
}
Definition bslmf_integralconstant.h:244

◆ BDLMT_THROTTLE_INIT_ALLOW_ALL

#define BDLMT_THROTTLE_INIT_ALLOW_ALL   BDLMT_THROTTLE_INIT(1, 0)

◆ BDLMT_THROTTLE_INIT_ALLOW_NONE

#define BDLMT_THROTTLE_INIT_ALLOW_NONE   BDLMT_THROTTLE_INIT(0, 1)

◆ BDLMT_THROTTLE_INIT_REALTIME

#define BDLMT_THROTTLE_INIT_REALTIME (   maxSimultaneousActions,
  nanosecondsPerAction 
)
Value:
{ \
{ -BloombergLP::bdlmt::Throttle::k_TEN_YEARS_NANOSECONDS }, \
BloombergLP::bdlmt::Throttle_InitHelper< \
(maxSimultaneousActions), \
(nanosecondsPerAction)>::k_npaValue, \
bsl::integral_constant<BloombergLP::bsls::Types::Int64, \
1LL * (maxSimultaneousActions) * (nanosecondsPerAction)>::value, \
BloombergLP::bdlmt::Throttle_InitHelper< \
(maxSimultaneousActions), \
(nanosecondsPerAction)>::k_msaValue, \
BloombergLP::bsls::SystemClockType::e_REALTIME \
}