µ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_stateless_default_resource< T > Class Template Reference

Standard allocator based on the RTOS system default memory manager. More...

#include <cmsis-plus/rtos/os.h>

Public Types

using value_type = T
 Type of elements to be allocated. More...
 

Public Member Functions

Constructors & Destructor
 allocator_stateless_default_resource () noexcept=default
 Default constructor. Construct a default resource allocator object instance. More...
 
 allocator_stateless_default_resource (allocator_stateless_default_resource const &other)=default
 Copy constructor. More...
 
template<typename U >
 allocator_stateless_default_resource (allocator_stateless_default_resource< U > const &other) noexcept
 Copy constructor template. More...
 
 allocator_stateless_default_resource (allocator_stateless_default_resource &&other)=default
 Move constructor. More...
 
 ~allocator_stateless_default_resource ()=default
 Destruct the default resource allocator object instance. More...
 
Operators
allocator_stateless_default_resourceoperator= (allocator_stateless_default_resource const &other)=default
 Copy assignment operator. More...
 
allocator_stateless_default_resourceoperator= (allocator_stateless_default_resource &&other)=default
 Move assignment operator. More...
 
Public Member Functions
value_typeallocate (std::size_t elements)
 Allocate a number of memory blocks of type value_type. More...
 
void deallocate (value_type *addr, std::size_t elements) noexcept
 Deallocate the number of memory blocks of type value_type. More...
 
std::size_t max_size (void) const noexcept
 The maximum number of elements that can be passed to allocate(). More...
 

Detailed Description

template<typename T>
class os::rtos::memory::allocator_stateless_default_resource< T >

Standard allocator based on the RTOS system default memory manager.

Template Parameters
TType of elements to be allocated.

This class template is used as the default allocator for system classes. It gets memory from the system default memory manager os::rtos::memory::get_default_resource().

Note
As default allocator, this class must be stateless, i.e. have no member variables.

Definition at line 82 of file os-decls.h.

Types

◆ value_type

Type of elements to be allocated.

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

Constructor & Destructor Documentation

◆ allocator_stateless_default_resource() [1/4]

Default constructor. Construct a default resource allocator object instance.

◆ allocator_stateless_default_resource() [2/4]

Copy constructor.

Parameters
otherReference to existing allocator.

◆ allocator_stateless_default_resource() [3/4]

template<typename T >
template<typename U >
os::rtos::memory::allocator_stateless_default_resource< T >::allocator_stateless_default_resource ( allocator_stateless_default_resource< U > const &  other)
inlinenoexcept

Copy constructor template.

Parameters
otherReference to allocator.

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

◆ allocator_stateless_default_resource() [4/4]

Move constructor.

Parameters
otherReference to existing allocator.

◆ ~allocator_stateless_default_resource()

Destruct the default resource allocator object instance.

Member Function Documentation

◆ allocate()

template<typename T >
allocator_stateless_default_resource< T >::value_type * os::rtos::memory::allocator_stateless_default_resource< T >::allocate ( std::size_t  elements)
inline

Allocate a number of memory blocks of type value_type.

Parameters
elementsNumber of elements of type value_type.
Returns
Pointer to newly allocated memory blocks.

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

◆ deallocate()

template<typename T >
void os::rtos::memory::allocator_stateless_default_resource< T >::deallocate ( value_type addr,
std::size_t  elements 
)
inlinenoexcept

Deallocate the number of memory blocks of type value_type.

Parameters
addrPointer to previously allocated memory blocks.
elementsNumber of elements of type value_type.
Returns
Nothing.

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

◆ max_size()

template<typename T >
std::size_t os::rtos::memory::allocator_stateless_default_resource< T >::max_size ( void  ) const
inlinenoexcept

The maximum number of elements that can be passed to allocate().

Returns
Number of elements of type value_type.

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

◆ operator=() [1/2]

Copy assignment operator.

Parameters
otherReference to existing allocator.
Returns
Reference to allocator.

◆ operator=() [2/2]

Move assignment operator.

Parameters
otherReference to existing allocator.
Returns
Reference to allocator.

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