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

A StoragePolicy that stores the allocator directly. More...

#include <wpi/memory/allocator_storage.hpp>

Public Types

using allocator_type = typename allocator_traits<RawAllocator>::allocator_type
 

Public Member Functions

 direct_storage ()=default
 
 direct_storage (allocator_type &&allocator) noexcept
 
 direct_storage (direct_storage &&other) noexcept
 
direct_storageoperator= (direct_storage &&other) noexcept
 
allocator_typeget_allocator () noexcept
 
const allocator_typeget_allocator () const noexcept
 

Protected Member Functions

 ~direct_storage () noexcept=default
 
bool is_composable () const noexcept
 

Detailed Description

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

A StoragePolicy that stores the allocator directly.

It embeds the allocator inside it, i.e. moving the storage policy will move the allocator.

Member Typedef Documentation

◆ allocator_type

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

Constructor & Destructor Documentation

◆ direct_storage() [1/3]

template<class RawAllocator >
wpi::memory::direct_storage< RawAllocator >::direct_storage ( )
default
Effects:
Creates it by default-constructing the allocator.
Requires:
The RawAllcoator must be default constructible.

◆ direct_storage() [2/3]

template<class RawAllocator >
wpi::memory::direct_storage< RawAllocator >::direct_storage ( allocator_type && allocator)
inlinenoexcept
Effects:
Creates it by moving in an allocator object.

◆ direct_storage() [3/3]

template<class RawAllocator >
wpi::memory::direct_storage< RawAllocator >::direct_storage ( direct_storage< RawAllocator > && other)
inlinenoexcept
Effects:
Moves the direct_storage object. This will move the stored allocator.

◆ ~direct_storage()

template<class RawAllocator >
wpi::memory::direct_storage< RawAllocator >::~direct_storage ( )
protecteddefaultnoexcept

Member Function Documentation

◆ get_allocator() [1/2]

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

◆ get_allocator() [2/2]

template<class RawAllocator >
allocator_type & wpi::memory::direct_storage< RawAllocator >::get_allocator ( )
inlinenoexcept
Returns:
A (const) reference to the stored allocator.

◆ is_composable()

template<class RawAllocator >
bool wpi::memory::direct_storage< RawAllocator >::is_composable ( ) const
inlineprotectednoexcept

◆ operator=()

template<class RawAllocator >
direct_storage & wpi::memory::direct_storage< RawAllocator >::operator= ( direct_storage< RawAllocator > && other)
inlinenoexcept

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