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

#include <bslma_testallocator.h>

Detailed 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.

See bslma_testallocator

Public Member Functions

 TestAllocatorStashedStatistics (TestAllocator *testAllocator)
 
void markRestored ()
 
void restore ()
 
bsls::Types::Int64 numBlocksInUse () const
 
bsls::Types::Int64 numBytesInUse () const
 
bsls::Types::Int64 numAllocations () const
 
bsls::Types::Int64 numDeallocations () const
 
bsls::Types::Int64 numMismatches () const
 
bsls::Types::Int64 numBoundsErrors () const
 
bsls::Types::Int64 numBlocksMax () const
 
bsls::Types::Int64 numBytesMax () const
 
bsls::Types::Int64 numBlocksTotal () const
 
bsls::Types::Int64 numBytesTotal () const
 
TestAllocatororigin () const
 

Constructor & Destructor Documentation

◆ TestAllocatorStashedStatistics()

bslma::TestAllocatorStashedStatistics::TestAllocatorStashedStatistics ( TestAllocator testAllocator)
inline

Create a TestAllocatorStashedStatistics object with its members initialized by the current statistics values of the specified testAllocator, and the address of it as origin.

Member Function Documentation

◆ markRestored()

void bslma::TestAllocatorStashedStatistics::markRestored ( )
inline

Set the origin to a null pointer to indicate that this stash has been restored and must not be used again with TestAllocator::restoreStatistics.

Precondition
The behavior is undefined if this function has been previously invoked on this object.

◆ numAllocations()

bsls::Types::Int64 bslma::TestAllocatorStashedStatistics::numAllocations ( ) const
inline

Return the numAllocations attribute value.

◆ numBlocksInUse()

bsls::Types::Int64 bslma::TestAllocatorStashedStatistics::numBlocksInUse ( ) const
inline

Return the numBlocksInUse attribute value.

◆ numBlocksMax()

bsls::Types::Int64 bslma::TestAllocatorStashedStatistics::numBlocksMax ( ) const
inline

Return the numBlocksMax attribute value.

◆ numBlocksTotal()

bsls::Types::Int64 bslma::TestAllocatorStashedStatistics::numBlocksTotal ( ) const
inline

Return the numBlocksTotal attribute value.

◆ numBoundsErrors()

bsls::Types::Int64 bslma::TestAllocatorStashedStatistics::numBoundsErrors ( ) const
inline

Return the numBoundsErrors attribute value.

◆ numBytesInUse()

bsls::Types::Int64 bslma::TestAllocatorStashedStatistics::numBytesInUse ( ) const
inline

Return the numBytesInUse attribute value.

◆ numBytesMax()

bsls::Types::Int64 bslma::TestAllocatorStashedStatistics::numBytesMax ( ) const
inline

Return the numBytesMax attribute value.

◆ numBytesTotal()

bsls::Types::Int64 bslma::TestAllocatorStashedStatistics::numBytesTotal ( ) const
inline

Return the numBytesTotal attribute value.

◆ numDeallocations()

bsls::Types::Int64 bslma::TestAllocatorStashedStatistics::numDeallocations ( ) const
inline

Return the numDeallocations attribute value.

◆ numMismatches()

bsls::Types::Int64 bslma::TestAllocatorStashedStatistics::numMismatches ( ) const
inline

Return the numMismatches attribute value.

◆ origin()

TestAllocator * bslma::TestAllocatorStashedStatistics::origin ( ) const
inline

Return a const pointer to the test allocator that was saved.

◆ restore()

void bslma::TestAllocatorStashedStatistics::restore ( )
inline

Call origin->restoreStatistics(*this).


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