BloombergLP::bslma::TestAllocatorStashedStatistics

Saved TestAllocator statistics for later restoration.

Synopsis

Declared in <bslma_testallocator.h>

class TestAllocatorStashedStatistics;

Description

This simple unconstrained attribute type is used to store all information necessary to restore the state of all statistics of a TestAllocator after a stashStatistics() call that resets them. See also TestAllocator::stashStatistics and TestAllocator::restoreStatistics.

Member Functions

NameDescription
TestAllocatorStashedStatistics [constructor]Create a stash of the current statistics of testAllocator.
markRestored Mark this stash as restored so it cannot be restored again.
numAllocations Return the numAllocations attribute value.
numBlocksInUse Return the numBlocksInUse attribute value.
numBlocksMax Return the numBlocksMax attribute value.
numBlocksTotal Return the numBlocksTotal attribute value.
numBoundsErrors Return the numBoundsErrors attribute value.
numBytesInUse Return the numBytesInUse attribute value.
numBytesMax Return the numBytesMax attribute value.
numBytesTotal Return the numBytesTotal attribute value.
numDeallocations Return the numDeallocations attribute value.
numMismatches Return the numMismatches attribute value.
origin Return a const pointer to the test allocator that was saved.
restore Call origin->restoreStatistics(*this).