CETL 0.0.0
 
Loading...
Searching...
No Matches
cetl::pmr::PmrInterfaceDeleter< Interface > Class Template Referencefinal

#include "cetl/pmr/interface_ptr.hpp"

Public Member Functions

 PmrInterfaceDeleter ()=default
 
template<typename PmrAllocator>
 PmrInterfaceDeleter (PmrAllocator alloc, std::size_t obj_count)
 
void operator() (Interface *ptr) noexcept
 

Detailed Description

template<typename Interface>
class cetl::pmr::PmrInterfaceDeleter< Interface >

RAII helper for cetl::pf17::pmr::polymorphic_allocator and std::pmr::polymorphic_allocator.

Use with cetl::pmr::InterfaceFactory for the best and safest experience. Remember, be safe, use the cetl::pmr::InterfaceFactory.

Note
See cetl::pmr::InterfaceFactory for an example of how to use this type.
Template Parameters
InterfaceThe interface type of the polymorphic allocator to use for deallocation.

Constructor & Destructor Documentation

◆ PmrInterfaceDeleter() [1/2]

template<typename Interface>
cetl::pmr::PmrInterfaceDeleter< Interface >::PmrInterfaceDeleter ( )
default

Constructs empty no-operation deleter.

Useful for initially empty InterfacePtr instance without deleter attached.

◆ PmrInterfaceDeleter() [2/2]

template<typename Interface>
template<typename PmrAllocator>
cetl::pmr::PmrInterfaceDeleter< Interface >::PmrInterfaceDeleter ( PmrAllocator alloc,
std::size_t obj_count )
inline

Constructs a Concrete type-erased deleter for the given interface type.

Template Parameters
PmrAllocatorThe type of the polymorphic allocator to use for deallocation.

Member Function Documentation

◆ operator()()

template<typename Interface>
void cetl::pmr::PmrInterfaceDeleter< Interface >::operator() ( Interface * ptr)
inlinenoexcept

Functor called by smart-pointer to deallocate and deconstruct objects.

Parameters
ptrThe object to deconstruct and deallocate.

References CETL_DEBUG_ASSERT.


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