zpp
Zephyr C++20 Framework
zpp::thread_id Class Reference

Thead ID. More...

#include <thread_id.hpp>

Public Member Functions

 thread_id (const thread_id &) noexcept=default
 
 thread_id (thread_id &&) noexcept=default
 
thread_idoperator= (const thread_id &) noexcept=default
 
thread_idoperator= (thread_id &&) noexcept=default
 
constexpr thread_id () noexcept
 Default constructor inializing ID to K_ANY. More...
 
constexpr thread_id (k_tid_t tid) noexcept
 Constructor inializing ID to tid. More...
 
constexpr operator bool () const noexcept
 test if the ID is valid More...
 
constexpr auto native_handle () const noexcept
 Get the Zephyr native ID value. More...
 

Static Public Member Functions

constexpr static thread_id any () noexcept
 Create an ID with value K_ANY. More...
 

Detailed Description

Thead ID.

Definition at line 18 of file thread_id.hpp.

Constructor & Destructor Documentation

◆ thread_id() [1/4]

zpp::thread_id::thread_id ( const thread_id )
defaultnoexcept

◆ thread_id() [2/4]

zpp::thread_id::thread_id ( thread_id &&  )
defaultnoexcept

◆ thread_id() [3/4]

constexpr zpp::thread_id::thread_id ( )
inlineconstexprnoexcept

Default constructor inializing ID to K_ANY.

Definition at line 28 of file thread_id.hpp.

29  {
30  }

Referenced by any().

◆ thread_id() [4/4]

constexpr zpp::thread_id::thread_id ( k_tid_t  tid)
inlineexplicitconstexprnoexcept

Constructor inializing ID to tid.

Parameters
tidThe ID to use for inialization

Definition at line 37 of file thread_id.hpp.

38  : m_tid(tid)
39  {
40  }

Member Function Documentation

◆ any()

constexpr static thread_id zpp::thread_id::any ( )
inlinestaticconstexprnoexcept

Create an ID with value K_ANY.

Returns
An ID with value K_ANY

Definition at line 57 of file thread_id.hpp.

58  {
59  return thread_id(K_ANY);
60  }
constexpr thread_id() noexcept
Default constructor inializing ID to K_ANY.
Definition: thread_id.hpp:28

References thread_id().

Referenced by zpp::thread::thread(), zpp::thread::abort(), zpp::thread::detach(), and zpp::thread::operator=().

◆ native_handle()

constexpr auto zpp::thread_id::native_handle ( ) const
inlineconstexprnoexcept

Get the Zephyr native ID value.

Returns
The native ID value

Definition at line 67 of file thread_id.hpp.

68  {
69  return m_tid;
70  }

◆ operator bool()

constexpr zpp::thread_id::operator bool ( ) const
inlineexplicitconstexprnoexcept

test if the ID is valid

Returns
false if the ID equals K_ANY

Definition at line 47 of file thread_id.hpp.

48  {
49  return m_tid != K_ANY;
50  }

◆ operator=() [1/2]

thread_id& zpp::thread_id::operator= ( const thread_id )
defaultnoexcept

◆ operator=() [2/2]

thread_id& zpp::thread_id::operator= ( thread_id &&  )
defaultnoexcept

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