[#BloombergLP-bslma-TestAllocatorStatisticsGuard] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::TestAllocatorStatisticsGuard :relfileprefix: ../../ :mrdocs: 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. == Synopsis Declared in `<bslma_testallocatorstatisticsguard.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class TestAllocatorStatisticsGuard; ---- == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslma/TestAllocatorStatisticsGuard/2constructor.adoc[`TestAllocatorStatisticsGuard`] [.small]#[constructor]# | Create a `TestAllocatorStatisticsGuard` object to stash, reset, and restore statistics of the specified `testAllocator`. | xref:BloombergLP/bslma/TestAllocatorStatisticsGuard/2destructor.adoc[`~TestAllocatorStatisticsGuard`] [.small]#[destructor]# | Destroy this object and restore the statistics of the `testAllocator` supplied at construction to a state as if this guard had never existed. | xref:BloombergLP/bslma/TestAllocatorStatisticsGuard/originalNumBlocksInUse.adoc[`originalNumBlocksInUse`] | Return the stashed value of `numBlocksInUse` at construction. | xref:BloombergLP/bslma/TestAllocatorStatisticsGuard/originalNumBytesInUse.adoc[`originalNumBytesInUse`] | Return the stashed value of `numBytesInUse` at construction. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#