zpp
Zephyr C++20 Framework
thread_data.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2019 Erwin Rol <erwin@erwinrol.com>
3 //
4 // SPDX-License-Identifier: Apache-2.0
5 //
6 
7 #ifndef ZPP_INCLUDE_ZPP_THREAD_DATA_HPP
8 #define ZPP_INCLUDE_ZPP_THREAD_DATA_HPP
9 
10 #include <zephyr/kernel.h>
11 #include <zephyr/sys/arch_interface.h>
12 #include <zephyr/sys/__assert.h>
13 
14 namespace zpp {
15 
19 class thread_data {
20 public:
21  //
22  // @brief Default constructor
23  //
24  constexpr thread_data() noexcept = default;
25 
26  constexpr auto native_handle() noexcept -> struct k_thread*
27  {
28  return &m_thread_data;
29  }
30 private:
31  struct k_thread m_thread_data;
32 public:
33  thread_data(const thread_data&) = delete;
34  thread_data(thread_data&&) = delete;
35  thread_data& operator=(const thread_data&) = delete;
37 };
38 
39 } // namespace zpp
40 
41 #endif // ZPP_INCLUDE_ZPP_THREAD_DATA_HPP
thread_data holds the stack and thread control block memory
Definition: thread_data.hpp:19
thread_data & operator=(const thread_data &)=delete
constexpr thread_data() noexcept=default
thread_data & operator=(thread_data &&)=delete
constexpr auto native_handle() noexcept -> struct k_thread *
Definition: thread_data.hpp:26
thread_data(const thread_data &)=delete
thread_data(thread_data &&)=delete