Sequoia
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
sequoia::testing::impl::allocation_checker< T, Getter > Class Template Reference

Wraps allocation_info, together with the prior allocation count. More...

#include <AllocationCheckersDetails.hpp>

Public Types

using value_type = T
 
using alloc_info = allocation_info< T, Getter >
 
using predictions_type = typename alloc_info::predictions_type
 
using allocator_type = typename alloc_info::allocator_type
 

Public Member Functions

 allocation_checker (alloc_info i, const int priorCount=0)
 
 allocation_checker (alloc_info i, const T &x)
 
template<test_mode Mode, auto Event>
bool check (std::string_view detail, test_logger< Mode > &logger, const T &container, const alloc_prediction< Event > prediction) const
 
const alloc_infoinfo () const noexcept
 

Detailed Description

template<movable_comparable T, alloc_getter< T > Getter>
class sequoia::testing::impl::allocation_checker< T, Getter >

Wraps allocation_info, together with the prior allocation count.

Consider a container, x, on which some potentially allocating operation is performed. Prior to this operation, an instantiation of the allocation_checker class template acquires the number of allocations already performed. Calling the check method after the operation of interest, the container is inspected via the function object stored in allocation_info. This allows the change in the number of allocations to be computed, which is then compared with the prediction.


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