Classes | Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
testing::ThrowingAllocator< T, Spec > Class Template Reference

#include <exception_safety_testing.h>

Inheritance diagram for testing::ThrowingAllocator< T, Spec >:
Inheritance graph
[legend]

Classes

struct  rebind
 

Public Types

using const_pointer = const T *
 
using const_reference = const T &
 
using const_void_pointer = const void *
 
using difference_type = ptrdiff_t
 
using is_always_equal = std::false_type
 
using is_nothrow = std::integral_constant< bool, Spec==AllocSpec::kNoThrowAllocate >
 
using pointer = T *
 
using propagate_on_container_copy_assignment = std::true_type
 
using propagate_on_container_move_assignment = std::true_type
 
using propagate_on_container_swap = std::true_type
 
using reference = T &
 
using size_type = size_t
 
using value_type = T
 
using void_pointer = void *
 

Public Member Functions

pointer allocate (size_type n) noexcept(IsSpecified(AllocSpec::kNoThrowAllocate))
 
pointer allocate (size_type n, const_void_pointer) noexcept(IsSpecified(AllocSpec::kNoThrowAllocate))
 
template<typename U , typename... Args>
void construct (U *ptr, Args &&... args) noexcept(IsSpecified(AllocSpec::kNoThrowAllocate))
 
void deallocate (pointer ptr, size_type) noexcept
 
template<typename U >
void destroy (U *p) noexcept
 
size_type max_size () const noexcept
 
template<typename U >
bool operator!= (const ThrowingAllocator< U, Spec > &other) const noexcept
 
ThrowingAllocatoroperator= (const ThrowingAllocator &other) noexcept
 
template<typename U >
ThrowingAllocatoroperator= (const ThrowingAllocator< U, Spec > &other) noexcept
 
template<typename U >
ThrowingAllocatoroperator= (ThrowingAllocator< U, Spec > &&other) noexcept
 
template<typename U >
bool operator== (const ThrowingAllocator< U, Spec > &other) const noexcept
 
ThrowingAllocator select_on_container_copy_construction () noexcept(IsSpecified(AllocSpec::kNoThrowAllocate))
 
 ThrowingAllocator ()
 
template<typename U >
 ThrowingAllocator (const ThrowingAllocator< U, Spec > &other) noexcept
 
 ThrowingAllocator (const ThrowingAllocator &other) noexcept
 
template<typename U >
 ThrowingAllocator (ThrowingAllocator< U, Spec > &&other) noexcept
 
 ThrowingAllocator (ThrowingAllocator &&other) noexcept
 
 ~ThrowingAllocator () noexcept=default
 

Private Member Functions

void ReadState ()
 
void ReadStateAndMaybeThrow (absl::string_view msg) const
 
const std::shared_ptr< const int > & State () const
 
std::shared_ptr< const int > & State ()
 
- Private Member Functions inherited from testing::exceptions_internal::TrackedObject
 TrackedObject (const TrackedObject &)=delete
 
 TrackedObject (TrackedObject &&)=delete
 
 TrackedObject (std::string description)
 
 ~TrackedObject () noexcept
 

Static Private Member Functions

static std::string GetInstanceString (int dummy)
 
static constexpr bool IsSpecified (AllocSpec spec)
 

Private Attributes

std::shared_ptr< const int > dummy_
 

Static Private Attributes

static int next_id_ = 0
 

Friends

template<typename , AllocSpec >
class ThrowingAllocator
 

Detailed Description

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
class testing::ThrowingAllocator< T, Spec >

Definition at line 618 of file exception_safety_testing.h.

Member Typedef Documentation

◆ const_pointer

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
using testing::ThrowingAllocator< T, Spec >::const_pointer = const T*

Definition at line 625 of file exception_safety_testing.h.

◆ const_reference

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
using testing::ThrowingAllocator< T, Spec >::const_reference = const T&

Definition at line 627 of file exception_safety_testing.h.

◆ const_void_pointer

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
using testing::ThrowingAllocator< T, Spec >::const_void_pointer = const void*

Definition at line 629 of file exception_safety_testing.h.

◆ difference_type

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
using testing::ThrowingAllocator< T, Spec >::difference_type = ptrdiff_t

Definition at line 632 of file exception_safety_testing.h.

◆ is_always_equal

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
using testing::ThrowingAllocator< T, Spec >::is_always_equal = std::false_type

Definition at line 639 of file exception_safety_testing.h.

◆ is_nothrow

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
using testing::ThrowingAllocator< T, Spec >::is_nothrow = std::integral_constant<bool, Spec == AllocSpec::kNoThrowAllocate>

Definition at line 635 of file exception_safety_testing.h.

◆ pointer

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
using testing::ThrowingAllocator< T, Spec >::pointer = T*

Definition at line 624 of file exception_safety_testing.h.

◆ propagate_on_container_copy_assignment

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
using testing::ThrowingAllocator< T, Spec >::propagate_on_container_copy_assignment = std::true_type

Definition at line 636 of file exception_safety_testing.h.

◆ propagate_on_container_move_assignment

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
using testing::ThrowingAllocator< T, Spec >::propagate_on_container_move_assignment = std::true_type

Definition at line 637 of file exception_safety_testing.h.

◆ propagate_on_container_swap

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
using testing::ThrowingAllocator< T, Spec >::propagate_on_container_swap = std::true_type

Definition at line 638 of file exception_safety_testing.h.

◆ reference

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
using testing::ThrowingAllocator< T, Spec >::reference = T&

Definition at line 626 of file exception_safety_testing.h.

◆ size_type

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
using testing::ThrowingAllocator< T, Spec >::size_type = size_t

Definition at line 631 of file exception_safety_testing.h.

◆ value_type

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
using testing::ThrowingAllocator< T, Spec >::value_type = T

Definition at line 630 of file exception_safety_testing.h.

◆ void_pointer

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
using testing::ThrowingAllocator< T, Spec >::void_pointer = void*

Definition at line 628 of file exception_safety_testing.h.

Constructor & Destructor Documentation

◆ ThrowingAllocator() [1/5]

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
testing::ThrowingAllocator< T, Spec >::ThrowingAllocator ( )
inline

Definition at line 641 of file exception_safety_testing.h.

◆ ThrowingAllocator() [2/5]

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
template<typename U >
testing::ThrowingAllocator< T, Spec >::ThrowingAllocator ( const ThrowingAllocator< U, Spec > &  other)
inlinenoexcept

Definition at line 647 of file exception_safety_testing.h.

◆ ThrowingAllocator() [3/5]

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
testing::ThrowingAllocator< T, Spec >::ThrowingAllocator ( const ThrowingAllocator< T, Spec > &  other)
inlinenoexcept

Definition at line 653 of file exception_safety_testing.h.

◆ ThrowingAllocator() [4/5]

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
template<typename U >
testing::ThrowingAllocator< T, Spec >::ThrowingAllocator ( ThrowingAllocator< U, Spec > &&  other)
inlinenoexcept

Definition at line 658 of file exception_safety_testing.h.

◆ ThrowingAllocator() [5/5]

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
testing::ThrowingAllocator< T, Spec >::ThrowingAllocator ( ThrowingAllocator< T, Spec > &&  other)
inlinenoexcept

Definition at line 662 of file exception_safety_testing.h.

◆ ~ThrowingAllocator()

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
testing::ThrowingAllocator< T, Spec >::~ThrowingAllocator ( )
defaultnoexcept

Member Function Documentation

◆ allocate() [1/2]

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
pointer testing::ThrowingAllocator< T, Spec >::allocate ( size_type  n)
inlinenoexcept

Definition at line 691 of file exception_safety_testing.h.

◆ allocate() [2/2]

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
pointer testing::ThrowingAllocator< T, Spec >::allocate ( size_type  n,
const_void_pointer   
)
inlinenoexcept

Definition at line 697 of file exception_safety_testing.h.

◆ construct()

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
template<typename U , typename... Args>
void testing::ThrowingAllocator< T, Spec >::construct ( U *  ptr,
Args &&...  args 
)
inlinenoexcept

Definition at line 708 of file exception_safety_testing.h.

◆ deallocate()

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
void testing::ThrowingAllocator< T, Spec >::deallocate ( pointer  ptr,
size_type   
)
inlinenoexcept

Definition at line 702 of file exception_safety_testing.h.

◆ destroy()

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
template<typename U >
void testing::ThrowingAllocator< T, Spec >::destroy ( U *  p)
inlinenoexcept

Definition at line 715 of file exception_safety_testing.h.

◆ GetInstanceString()

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
static std::string testing::ThrowingAllocator< T, Spec >::GetInstanceString ( int  dummy)
inlinestaticprivate

Definition at line 745 of file exception_safety_testing.h.

◆ IsSpecified()

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
static constexpr bool testing::ThrowingAllocator< T, Spec >::IsSpecified ( AllocSpec  spec)
inlinestaticprivate

Definition at line 619 of file exception_safety_testing.h.

◆ max_size()

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
size_type testing::ThrowingAllocator< T, Spec >::max_size ( ) const
inlinenoexcept

Definition at line 720 of file exception_safety_testing.h.

◆ operator!=()

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
template<typename U >
bool testing::ThrowingAllocator< T, Spec >::operator!= ( const ThrowingAllocator< U, Spec > &  other) const
inlinenoexcept

Definition at line 737 of file exception_safety_testing.h.

◆ operator=() [1/3]

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
ThrowingAllocator& testing::ThrowingAllocator< T, Spec >::operator= ( const ThrowingAllocator< T, Spec > &  other)
inlinenoexcept

Definition at line 668 of file exception_safety_testing.h.

◆ operator=() [2/3]

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
template<typename U >
ThrowingAllocator& testing::ThrowingAllocator< T, Spec >::operator= ( const ThrowingAllocator< U, Spec > &  other)
inlinenoexcept

Definition at line 674 of file exception_safety_testing.h.

◆ operator=() [3/3]

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
template<typename U >
ThrowingAllocator& testing::ThrowingAllocator< T, Spec >::operator= ( ThrowingAllocator< U, Spec > &&  other)
inlinenoexcept

Definition at line 681 of file exception_safety_testing.h.

◆ operator==()

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
template<typename U >
bool testing::ThrowingAllocator< T, Spec >::operator== ( const ThrowingAllocator< U, Spec > &  other) const
inlinenoexcept

Definition at line 732 of file exception_safety_testing.h.

◆ ReadState()

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
void testing::ThrowingAllocator< T, Spec >::ReadState ( )
inlineprivate

Definition at line 754 of file exception_safety_testing.h.

◆ ReadStateAndMaybeThrow()

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
void testing::ThrowingAllocator< T, Spec >::ReadStateAndMaybeThrow ( absl::string_view  msg) const
inlineprivate

Definition at line 760 of file exception_safety_testing.h.

◆ select_on_container_copy_construction()

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
ThrowingAllocator testing::ThrowingAllocator< T, Spec >::select_on_container_copy_construction ( )
inlinenoexcept

Definition at line 724 of file exception_safety_testing.h.

◆ State() [1/2]

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
const std::shared_ptr<const int>& testing::ThrowingAllocator< T, Spec >::State ( ) const
inlineprivate

Definition at line 751 of file exception_safety_testing.h.

◆ State() [2/2]

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
std::shared_ptr<const int>& testing::ThrowingAllocator< T, Spec >::State ( )
inlineprivate

Definition at line 752 of file exception_safety_testing.h.

Friends And Related Function Documentation

◆ ThrowingAllocator

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
template<typename , AllocSpec >
friend class ThrowingAllocator
friend

Definition at line 742 of file exception_safety_testing.h.

Member Data Documentation

◆ dummy_

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
std::shared_ptr<const int> testing::ThrowingAllocator< T, Spec >::dummy_
private

Definition at line 768 of file exception_safety_testing.h.

◆ next_id_

template<typename T, AllocSpec Spec = AllocSpec::kEverythingThrows>
int testing::ThrowingAllocator< T, Spec >::next_id_ = 0
staticprivate

Definition at line 767 of file exception_safety_testing.h.


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


abseil_cpp
Author(s):
autogenerated on Mon Feb 28 2022 21:31:23