zpp
Zephyr C++20 Framework
zpp::heap< T_Size > Class Template Reference

heap class More...

#include <heap.hpp>

Inheritance diagram for zpp::heap< T_Size >:
[legend]
Collaboration diagram for zpp::heap< T_Size >:
[legend]

Public Member Functions

 heap () noexcept
 The default constructor. More...
 
constexpr auto native_handle () noexcept -> native_pointer
 get the native zephyr heap handle. More...
 
constexpr auto native_handle () const noexcept -> native_const_pointer
 get the native zephyr heap handle. More...
 
 heap (const heap &)=delete
 
 heap (heap &&)=delete
 
heapoperator= (const heap &)=delete
 
heapoperator= (heap &&)=delete
 
- Public Member Functions inherited from zpp::base_heap< heap< T_Size > >
 base_heap (const base_heap &)=delete
 
 base_heap (base_heap &&)=delete
 
void * allocate (size_t bytes) noexcept
 Allocate memory from this heap wainting forever. More...
 
void * allocate (size_t bytes, size_t align) noexcept
 Allocate memory from this heap waiting forever. More...
 
void * try_allocate (size_t bytes) noexcept
 Allocate memory from this heap without waiting. More...
 
void * try_allocate (size_t bytes, size_t align) noexcept
 Allocate memory from this heap without waiting. More...
 
void * try_allocate_for (size_t bytes, const std::chrono::duration< T_Rep, T_Period > &timeout) noexcept
 Allocate memory from this heap waiting with a timeout. More...
 
void * try_allocate_for (size_t bytes, size_t align, const std::chrono::duration< T_Rep, T_Period > &timeout) noexcept
 Allocate memory from this heap waiting with a timeout. More...
 
void deallocate (void *mem) noexcept
 Deallocate memory previously allocated. More...
 
auto native_handle () noexcept -> native_pointer
 get the native zephyr heap handle. More...
 
auto native_handle () const noexcept -> native_const_pointer
 get the native zephyr heap handle. More...
 
base_heapoperator= (const base_heap &)=delete
 
base_heapoperator= (base_heap &&)=delete
 

Static Public Member Functions

static constexpr size_t size () noexcept
 Return the total size of this heap. More...
 

Additional Inherited Members

- Public Types inherited from zpp::base_heap< heap< T_Size > >
using native_type = struct k_heap
 
using native_pointer = native_type *
 
using native_const_pointer = native_type const *
 
- Protected Member Functions inherited from zpp::base_heap< heap< T_Size > >
constexpr base_heap () noexcept
 default protected constructor so only derived objects can be created More...
 

Detailed Description

template<size_t T_Size>
class zpp::heap< T_Size >

heap class

Definition at line 159 of file heap.hpp.

Constructor & Destructor Documentation

◆ heap() [1/3]

template<size_t T_Size>
zpp::heap< T_Size >::heap ( )
inlinenoexcept

The default constructor.

Definition at line 168 of file heap.hpp.

168  {
169  k_heap_init(&m_heap, m_mem.data(), m_mem.size());
170  }

◆ heap() [2/3]

template<size_t T_Size>
zpp::heap< T_Size >::heap ( const heap< T_Size > &  )
delete

◆ heap() [3/3]

template<size_t T_Size>
zpp::heap< T_Size >::heap ( heap< T_Size > &&  )
delete

Member Function Documentation

◆ native_handle() [1/2]

template<size_t T_Size>
constexpr auto zpp::heap< T_Size >::native_handle ( ) const -> native_const_pointer
inlineconstexprnoexcept

get the native zephyr heap handle.

Returns
A pointer to the zephyr k_heap.

Definition at line 196 of file heap.hpp.

197  {
198  return &m_heap;
199  }

◆ native_handle() [2/2]

template<size_t T_Size>
constexpr auto zpp::heap< T_Size >::native_handle ( ) -> native_pointer
inlineconstexprnoexcept

get the native zephyr heap handle.

Returns
A pointer to the zephyr k_heap.

Definition at line 186 of file heap.hpp.

187  {
188  return &m_heap;
189  }

◆ operator=() [1/2]

template<size_t T_Size>
heap& zpp::heap< T_Size >::operator= ( const heap< T_Size > &  )
delete

◆ operator=() [2/2]

template<size_t T_Size>
heap& zpp::heap< T_Size >::operator= ( heap< T_Size > &&  )
delete

◆ size()

template<size_t T_Size>
static constexpr size_t zpp::heap< T_Size >::size ( )
inlinestaticconstexprnoexcept

Return the total size of this heap.

Returns
The heap size in bytes

Definition at line 177 of file heap.hpp.

177  {
178  return T_Size;
179  }

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