BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bslma::TestAllocatorStatisticsGuard Class Reference

#include <bslma_testallocatorstatisticsguard.h>

Detailed Description

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 Statistics section for the statistics managed.

See bslma_testallocatorstatisticsguard

Public Member Functions

 TestAllocatorStatisticsGuard (TestAllocator *testAllocator)
 
 ~TestAllocatorStatisticsGuard ()
 
bsls::Types::Int64 originalNumBlocksInUse () const
 
bsls::Types::Int64 originalNumBytesInUse () const
 

Constructor & Destructor Documentation

◆ TestAllocatorStatisticsGuard()

bslma::TestAllocatorStatisticsGuard::TestAllocatorStatisticsGuard ( TestAllocator testAllocator)
inlineexplicit

Create a TestAllocatorStatisticsGuard object to stash, reset, and restore statistics of the specified testAllocator.

◆ ~TestAllocatorStatisticsGuard()

bslma::TestAllocatorStatisticsGuard::~TestAllocatorStatisticsGuard ( )
inline

Destroy this object and restore the statistics of the testAllocator supplied at construction to a state as if this guard had never existed.

Member Function Documentation

◆ originalNumBlocksInUse()

bsls::Types::Int64 bslma::TestAllocatorStatisticsGuard::originalNumBlocksInUse ( ) const
inline

Return the stashed value of numBlocksInUse at construction.

◆ originalNumBytesInUse()

bsls::Types::Int64 bslma::TestAllocatorStatisticsGuard::originalNumBytesInUse ( ) const
inline

Return the stashed value of numBytesInUse at construction.


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