WPILibC++ 2025.1.1
Loading...
Searching...
No Matches
wpi::memory::threshold_segregatable< RawAllocator > Class Template Reference

A Segregatable that allocates until a maximum size. More...

#include <wpi/memory/segregator.hpp>

Public Types

using allocator_type = typename allocator_traits<RawAllocator>::allocator_type
 

Public Member Functions

 threshold_segregatable (std::size_t max_size, allocator_type alloc=allocator_type())
 
bool use_allocate_node (std::size_t size, std::size_t) noexcept
 
bool use_allocate_array (std::size_t count, std::size_t size, std::size_t) noexcept
 
allocator_typeget_allocator () noexcept
 
const allocator_typeget_allocator () const noexcept
 

Detailed Description

template<class RawAllocator>
class wpi::memory::threshold_segregatable< RawAllocator >

A Segregatable that allocates until a maximum size.

Member Typedef Documentation

◆ allocator_type

template<class RawAllocator >
using wpi::memory::threshold_segregatable< RawAllocator >::allocator_type = typename allocator_traits<RawAllocator>::allocator_type

Constructor & Destructor Documentation

◆ threshold_segregatable()

template<class RawAllocator >
wpi::memory::threshold_segregatable< RawAllocator >::threshold_segregatable ( std::size_t max_size,
allocator_type alloc = allocator_type() )
inlineexplicit
Effects:
Creates it by passing the maximum size it will allocate and the allocator it uses.

Member Function Documentation

◆ get_allocator() [1/2]

template<class RawAllocator >
const allocator_type & wpi::memory::threshold_segregatable< RawAllocator >::get_allocator ( ) const
inlinenoexcept

◆ get_allocator() [2/2]

template<class RawAllocator >
allocator_type & wpi::memory::threshold_segregatable< RawAllocator >::get_allocator ( )
inlinenoexcept
Returns:
A reference to the allocator it owns.

◆ use_allocate_array()

template<class RawAllocator >
bool wpi::memory::threshold_segregatable< RawAllocator >::use_allocate_array ( std::size_t count,
std::size_t size,
std::size_t  )
inlinenoexcept
Returns:
true if count * size is less then or equal to the maximum size, false otherwise.
Note
A return value of true means that the allocator will be used for the allocation.

◆ use_allocate_node()

template<class RawAllocator >
bool wpi::memory::threshold_segregatable< RawAllocator >::use_allocate_node ( std::size_t size,
std::size_t  )
inlinenoexcept
Returns:
true if size is less then or equal to the maximum size, false otherwise.
Note
A return value of true means that the allocator will be used for the allocation.

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