Loading...
Searching...
No Matches
gpr::memory::ScopedHeap Class Reference

#include <gpr/memory/ScopedHeap.h>

Public Member Functions

 ScopedHeap ()=default
 ScopedHeap (const ScopedHeap &)=delete
ScopedHeap & operator= (const ScopedHeap &)=delete
 ScopedHeap (ScopedHeap &&) noexcept=default
ScopedHeap & operator= (ScopedHeap &&) noexcept=default
template<typename T>
HeapAllocator< T > allocator () const
template<typename T>
HeapVector< T > make_vector () const

Detailed Description

Definition at line 107 of file ScopedHeap.h.

Constructor & Destructor Documentation

◆ ScopedHeap() [1/3]

gpr::memory::ScopedHeap::ScopedHeap ( )
default

◆ ScopedHeap() [2/3]

gpr::memory::ScopedHeap::ScopedHeap ( const ScopedHeap & )
delete

◆ ScopedHeap() [3/3]

gpr::memory::ScopedHeap::ScopedHeap ( ScopedHeap && )
defaultnoexcept

Member Function Documentation

◆ allocator()

template<typename T>
HeapAllocator< T > gpr::memory::ScopedHeap::allocator ( ) const
inline

Definition at line 120 of file ScopedHeap.h.

121 {
122#ifdef USE_MIMALLOC
123 if (!heap_) throw std::bad_alloc();
124 return HeapAllocator<T>(heap_);
125#else
126 return HeapAllocator<T>();
127#endif
128 }
std::allocator< T > HeapAllocator
Definition ScopedHeap.h:98

◆ make_vector()

template<typename T>
HeapVector< T > gpr::memory::ScopedHeap::make_vector ( ) const
inline

Definition at line 131 of file ScopedHeap.h.

132 {
133 return HeapVector<T>(allocator<T>());
134 }
HeapAllocator< T > allocator() const
Definition ScopedHeap.h:120
std::vector< T, HeapAllocator< T > > HeapVector
Definition ScopedHeap.h:102

◆ operator=() [1/2]

ScopedHeap & gpr::memory::ScopedHeap::operator= ( const ScopedHeap & )
delete

◆ operator=() [2/2]

ScopedHeap & gpr::memory::ScopedHeap::operator= ( ScopedHeap && )
defaultnoexcept

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