Quick Links:

bal | bbl | bdl | bsl

Public Member Functions

balb::ReservationGuard< TYPE > Class Template Reference

#include <balb_reservationguard.h>

List of all members.

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
bsls::Types::Uint64 unitsReserved () const

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:

For terminology see bsldoc_glossary.

See Component balb_reservationguard


Constructor & Destructor Documentation

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

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

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

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


Member Function Documentation

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

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().

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

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().

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

Return a pointer to the rate controlling object used by this object.

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

Return the number of units reserved by this object.


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