BDE 4.14.0 Production release
Loading...
Searching...
No Matches
balb::ReservationGuard< TYPE > Class Template Reference

#include <balb_reservationguard.h>

Public Member Functions

 ReservationGuard (TYPE *rateController, bsls::Types::Uint64 numUnits)
 
 ~ReservationGuard ()
 
void cancelReserved (bsls::Types::Uint64 numUnits)
 
void submitReserved (bsls::Types::Uint64 numUnits)
 
TYPE * ptr () const
 Return a pointer to the rate controlling object used by this object.
 
bsls::Types::Uint64 unitsReserved () const
 Return the number of units reserved by this object.
 

Detailed Description

template<class TYPE>
class balb::ReservationGuard< TYPE >

This class template implements a proctor for reserving and cancelling units in a rate controlling object.

This class:

  • is exception neutral (agnostic)
  • is const thread-safe For terminology see bsldoc_glossary .

See balb_reservationguard

Constructor & Destructor Documentation

◆ ReservationGuard()

template<class TYPE >
balb::ReservationGuard< TYPE >::ReservationGuard ( TYPE *  rateController,
bsls::Types::Uint64  numUnits 
)
inline

Create a ReservationGuard object guarding the specified rateController and reserving the specified numUnits.

◆ ~ReservationGuard()

template<class TYPE >
balb::ReservationGuard< TYPE >::~ReservationGuard ( )
inline

Destroy this object. Invoke the cancelReserved method for the remaining remaining units reserved by this proctor.

Member Function Documentation

◆ cancelReserved()

template<class TYPE >
void balb::ReservationGuard< TYPE >::cancelReserved ( bsls::Types::Uint64  numUnits)
inline

Cancel the specified numUnits from the reserve units guarded by this object. Subtract the numUnits from unitsReserved and invoke the cancelReserved method on the guarded object for numUnits. After this operation, the number of reserved units guarded by this object will be reduced by numUnits. The behavior is undefined unless numUnits <= unitsReserved().

◆ ptr()

template<class TYPE >
TYPE * balb::ReservationGuard< TYPE >::ptr ( ) const
inline

◆ submitReserved()

template<class TYPE >
void balb::ReservationGuard< TYPE >::submitReserved ( bsls::Types::Uint64  numUnits)
inline

Submit the specified numUnits from the reserve units guarded by this object. After this operation, the number of reserved units guarded by this object will be reduced by numUnits. The behavior is undefined unless numUnits <= unitsReserved().

◆ unitsReserved()

template<class TYPE >
bsls::Types::Uint64 balb::ReservationGuard< TYPE >::unitsReserved ( ) const
inline

The documentation for this class was generated from the following file: