[#BloombergLP-balb-ReservationGuard] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balb.adoc[balb]::ReservationGuard :relfileprefix: ../../ :mrdocs: This class template implements a proctor for reserving and cancelling units in a rate controlling object. == Synopsis Declared in `<balb_reservationguard.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE> class ReservationGuard; ---- == Description This class: * is _exception_ _neutral_ (agnostic) * is _const_ _thread‐safe_ For terminology see `bsldoc_glossary`. == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/balb/ReservationGuard/2constructor.adoc[`ReservationGuard`] [.small]#[constructor]# | Create a `ReservationGuard` object guarding the specified `rateController` and reserving the specified `numUnits`. | xref:BloombergLP/balb/ReservationGuard/2destructor.adoc[`~ReservationGuard`] [.small]#[destructor]# | Destroy this object. Invoke the `cancelReserved` method for the remaining remaining units reserved by this proctor. | xref:BloombergLP/balb/ReservationGuard/cancelReserved.adoc[`cancelReserved`] | 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()`. | xref:BloombergLP/balb/ReservationGuard/ptr.adoc[`ptr`] | Return a pointer to the rate controlling object used by this object. | xref:BloombergLP/balb/ReservationGuard/submitReserved.adoc[`submitReserved`] | 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()`. | xref:BloombergLP/balb/ReservationGuard/unitsReserved.adoc[`unitsReserved`] | Return the number of units reserved by this object. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#