µ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_polymorphic_synchronized< T, L, get_resource > Class Template Reference

Allocator using memory resources. More...

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

Classes

struct  rebind
 Define a rebind template. More...
 

Public Types

using locker_type = L
 
using value_type = T
 

Public Member Functions

Constructors & Destructor
 allocator_stateless_polymorphic_synchronized () noexcept
 Default constructor. Construct a default allocator object instance. More...
 
 allocator_stateless_polymorphic_synchronized (allocator_stateless_polymorphic_synchronized const &other)=default
 Copy constructor. More...
 
template<typename U >
 allocator_stateless_polymorphic_synchronized (allocator_stateless_polymorphic_synchronized< U, L, get_resource > const &other) noexcept
 Copy constructor template. More...
 
 allocator_stateless_polymorphic_synchronized (allocator_stateless_polymorphic_synchronized &&other)=default
 Move constructor. More...
 
 ~allocator_stateless_polymorphic_synchronized ()=default
 Destruct the default allocator object instance. More...
 
Operators
allocator_stateless_polymorphic_synchronizedoperator= (allocator_stateless_polymorphic_synchronized const &other)=default
 Copy assignment operator. More...
 
allocator_stateless_polymorphic_synchronizedoperator= (allocator_stateless_polymorphic_synchronized &&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, typename L, F get_resource>
class os::rtos::memory::allocator_stateless_polymorphic_synchronized< T, L, get_resource >

Allocator using memory resources.

Template Parameters
TType of elements to be allocated.
LType of lockable object.
get_resourceFunction to get the default resource.

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

Types

◆ locker_type

template<typename T, typename L, F get_resource>
using os::rtos::memory::allocator_stateless_polymorphic_synchronized< T, L, get_resource >::locker_type = L

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

◆ value_type

template<typename T, typename L, F get_resource>
using os::rtos::memory::allocator_stateless_polymorphic_synchronized< T, L, get_resource >::value_type = T

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

Constructor & Destructor Documentation

◆ allocator_stateless_polymorphic_synchronized() [1/4]

template<typename T , typename L , F get_resource>
os::rtos::memory::allocator_stateless_polymorphic_synchronized< T, L, get_resource >::allocator_stateless_polymorphic_synchronized ( )
inlinenoexcept

Default constructor. Construct a default allocator object instance.

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

◆ allocator_stateless_polymorphic_synchronized() [2/4]

template<typename T, typename L, F get_resource>
os::rtos::memory::allocator_stateless_polymorphic_synchronized< T, L, get_resource >::allocator_stateless_polymorphic_synchronized ( allocator_stateless_polymorphic_synchronized< T, L, get_resource > const &  other)
default

Copy constructor.

Parameters
otherReference to existing allocator.

◆ allocator_stateless_polymorphic_synchronized() [3/4]

template<typename T , typename L , F get_resource>
template<typename U >
os::rtos::memory::allocator_stateless_polymorphic_synchronized< T, L, get_resource >::allocator_stateless_polymorphic_synchronized ( allocator_stateless_polymorphic_synchronized< U, L, get_resource > const &  other)
inlinenoexcept

Copy constructor template.

Parameters
otherReference to allocator.

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

◆ allocator_stateless_polymorphic_synchronized() [4/4]

template<typename T, typename L, F get_resource>
os::rtos::memory::allocator_stateless_polymorphic_synchronized< T, L, get_resource >::allocator_stateless_polymorphic_synchronized ( allocator_stateless_polymorphic_synchronized< T, L, get_resource > &&  other)
default

Move constructor.

Parameters
otherReference to existing allocator.

◆ ~allocator_stateless_polymorphic_synchronized()

template<typename T, typename L, F get_resource>
os::rtos::memory::allocator_stateless_polymorphic_synchronized< T, L, get_resource >::~allocator_stateless_polymorphic_synchronized ( )
default

Destruct the default allocator object instance.

Member Function Documentation

◆ allocate()

template<typename T , typename L , F get_resource>
allocator_stateless_polymorphic_synchronized< T, L, get_resource >::value_type * os::rtos::memory::allocator_stateless_polymorphic_synchronized< T, L, get_resource >::allocate ( std::size_t  elements)

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 1556 of file os-memory.h.

◆ deallocate()

template<typename T , typename L , F get_resource>
void os::rtos::memory::allocator_stateless_polymorphic_synchronized< T, L, get_resource >::deallocate ( value_type addr,
std::size_t  elements 
)
noexcept

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 1582 of file os-memory.h.

◆ max_size()

template<typename T , typename L , F get_resource>
std::size_t os::rtos::memory::allocator_stateless_polymorphic_synchronized< T, L, get_resource >::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 1605 of file os-memory.h.

◆ operator=() [1/2]

template<typename T, typename L, F get_resource>
allocator_stateless_polymorphic_synchronized& os::rtos::memory::allocator_stateless_polymorphic_synchronized< T, L, get_resource >::operator= ( allocator_stateless_polymorphic_synchronized< T, L, get_resource > const &  other)
default

Copy assignment operator.

Parameters
otherReference to existing allocator.
Returns
Reference to allocator.

◆ operator=() [2/2]

template<typename T, typename L, F get_resource>
allocator_stateless_polymorphic_synchronized& os::rtos::memory::allocator_stateless_polymorphic_synchronized< T, L, get_resource >::operator= ( allocator_stateless_polymorphic_synchronized< T, L, get_resource > &&  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: