µOS++ IIIe Reference  v6.3.15
“Perfekt ist nicht gut genug”
The third edition of µOS++, a POSIX inspired open source system, written in C++.
os::rtos::memory::allocator_deleter< A > Class Template Reference

Allocator deleter. More...

#include <os-memory.h>

Public Types

using allocator_traits = std::allocator_traits< A >
 Standard allocator traits definition. More...
 
using allocator_type = A
 Standard allocator type definition. More...
 
using pointer = typename allocator_traits::pointer
 

Public Member Functions

Constructors & Destructor
 allocator_deleter ()
 Default constructor. More...
 
 allocator_deleter (const allocator_type &other)
 Copy constructor. More...
 
 allocator_deleter (allocator_deleter &&other)=default
 Move constructor. More...
 
 ~allocator_deleter ()=default
 Destruct the allocator deleter. More...
 
Operators
allocator_deleteroperator= (const allocator_deleter &other)=default
 Copy assignment operator. More...
 
allocator_deleteroperator= (allocator_deleter &&other)=default
 Move assignment operator. More...
 
void operator() (pointer addr) const
 Function operator. More...
 

Detailed Description

template<typename A>
class os::rtos::memory::allocator_deleter< A >

Allocator deleter.

Template Parameters
AAllocator type.

This class acts as a function to be used as deleter by smart pointers, like unique_ptr<>.

It refers to the allocator to destruct and deallocate the object.

Definition at line 841 of file os-memory.h.

Types

◆ allocator_traits

template<typename A >
using os::rtos::memory::allocator_deleter< A >::allocator_traits = std::allocator_traits<A>

Standard allocator traits definition.

Definition at line 853 of file os-memory.h.

◆ allocator_type

template<typename A >
using os::rtos::memory::allocator_deleter< A >::allocator_type = A

Standard allocator type definition.

Definition at line 848 of file os-memory.h.

◆ pointer

template<typename A >
using os::rtos::memory::allocator_deleter< A >::pointer = typename allocator_traits::pointer

Definition at line 855 of file os-memory.h.

Constructor & Destructor Documentation

◆ allocator_deleter() [1/3]

template<typename A >
os::rtos::memory::allocator_deleter< A >::allocator_deleter ( )
inline

Default constructor.

Definition at line 1633 of file os-memory.h.

◆ allocator_deleter() [2/3]

template<typename A >
os::rtos::memory::allocator_deleter< A >::allocator_deleter ( const allocator_type other)
inline

Copy constructor.

Parameters
otherReference to allocator.

Definition at line 1640 of file os-memory.h.

◆ allocator_deleter() [3/3]

template<typename A >
os::rtos::memory::allocator_deleter< A >::allocator_deleter ( allocator_deleter< A > &&  other)
default

Move constructor.

Parameters
otherReference to existing allocator.

◆ ~allocator_deleter()

template<typename A >
os::rtos::memory::allocator_deleter< A >::~allocator_deleter ( )
default

Destruct the allocator deleter.

Member Function Documentation

◆ operator()()

template<typename A >
void os::rtos::memory::allocator_deleter< A >::operator() ( pointer  addr) const
inline

Function operator.

Function operator to delete an allocated object.

Parameters
addrPointer to memory to deallocate.
addrPointer to object.

Use allocator_traits to destroy and deallocate the object.

Definition at line 1656 of file os-memory.h.

◆ operator=() [1/2]

template<typename A >
allocator_deleter& os::rtos::memory::allocator_deleter< A >::operator= ( const allocator_deleter< A > &  other)
default

Copy assignment operator.

Parameters
otherReference to existing allocator.
Returns
Reference to allocator.

◆ operator=() [2/2]

template<typename A >
allocator_deleter& os::rtos::memory::allocator_deleter< A >::operator= ( allocator_deleter< A > &&  other)
default

Move assignment operator.

Parameters
otherReference to existing allocator.
Returns
Reference to allocator.

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