µOS++ IIIe Reference 7.0.0
The third edition of µOS++, a POSIX inspired open source framework, written in C++
Loading...
Searching...
No Matches
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.
 
 allocator_stateless_polymorphic_synchronized (allocator_stateless_polymorphic_synchronized const &other)=default
 Copy constructor.
 
template<typename U >
 allocator_stateless_polymorphic_synchronized (allocator_stateless_polymorphic_synchronized< U, L, get_resource > const &other) noexcept
 Copy constructor template.
 
 allocator_stateless_polymorphic_synchronized (allocator_stateless_polymorphic_synchronized &&other)=default
 Move constructor.
 
 ~allocator_stateless_polymorphic_synchronized ()=default
 Destruct the default allocator object instance.
 
Operators
allocator_stateless_polymorphic_synchronizedoperator= (allocator_stateless_polymorphic_synchronized const &other)=default
 Copy assignment operator.
 
allocator_stateless_polymorphic_synchronizedoperator= (allocator_stateless_polymorphic_synchronized &&other)=default
 Move assignment operator.
 
Public Member Functions
value_typeallocate (std::size_t elements)
 Allocate a number of memory blocks of type value_type.
 
void deallocate (value_type *addr, std::size_t elements) noexcept
 Deallocate the number of memory blocks of type value_type.
 
std::size_t max_size (void) const noexcept
 The maximum number of elements that can be passed to allocate().
 

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

Member Typedef Documentation

◆ 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 686 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 685 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 ( )
noexcept

Default constructor. Construct a default allocator object instance.

◆ 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)
noexcept

Copy constructor template.

Parameters
otherReference to allocator.

◆ 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>
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.

◆ 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.

◆ 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
noexcept

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

Returns
Number of elements of type value_type.

◆ 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 > &&  other)
default

Move 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 > const &  other)
default

Copy assignment operator.

Parameters
otherReference to existing allocator.
Returns
Reference to allocator.

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