BloombergLP::bslma::TestAllocatorStashedStatistics

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.

Synopsis

Declared in <bslma_testallocator.h>

class TestAllocatorStashedStatistics;

Member Functions

NameDescription
TestAllocatorStashedStatistics [constructor]Create a TestAllocatorStashedStatistics object with its members initialized by the current statistics values of the specified testAllocator, and the address of it as origin.
markRestored Set the origin to a null pointer to indicate that this stash has been restored and must not be used again with TestAllocator::restoreStatistics. The behavior is undefined if this function has been previously invoked on this object.
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).