This mechanism provides scoped, localized statistics for a TestAllocator.
Declared in <bslma_testallocatorstatisticsguard.h>
class TestAllocatorStatisticsGuard;
This mechanism provides the means to get localized TestAllocator statistics in a scope since the construction of the guard, and also reinstates the statistics upon its destruction as if the local reset has not happened. See the section for the statistics managed.
| Name | Description |
|---|---|
TestAllocatorStatisticsGuard [constructor] | Create a TestAllocatorStatisticsGuard object to stash, reset, and restore statistics of the specified testAllocator. |
~TestAllocatorStatisticsGuard [destructor] | Destroy this object and restore the statistics of the testAllocator supplied at construction to a state as if this guard had never existed. |
originalNumBlocksInUse | Return the stashed value of numBlocksInUse at construction. |
originalNumBytesInUse | Return the stashed value of numBytesInUse at construction. |