idfxx 1.0.0
Modern C++23 components for ESP-IDF
Loading...
Searching...
No Matches
idfxx::task_priority Class Reference

Type-safe wrapper for FreeRTOS task priority values. More...

Public Member Functions

constexpr task_priority () noexcept
 Default constructor.
 
constexpr task_priority (unsigned int value) noexcept
 Constructs from an unsigned integer value.
 
constexpr unsigned int value () const noexcept
 Returns the raw priority value.
 
constexpr auto operator<=> (const task_priority &) const noexcept=default
 Default three-way comparison.
 

Detailed Description

Type-safe wrapper for FreeRTOS task priority values.

Wraps an unsigned integer priority level with implicit conversion from unsigned int, so designated initializers like .priority = 5 work without change.

// Direct construction
// Implicit conversion from unsigned int
// Access raw value for FreeRTOS APIs
vTaskPrioritySet(handle, p.value());
Type-safe wrapper for FreeRTOS task priority values.
Definition cpu.hpp:84
constexpr unsigned int value() const noexcept
Returns the raw priority value.
Definition cpu.hpp:104

Definition at line 84 of file cpu.hpp.

Constructor & Destructor Documentation

◆ task_priority() [1/2]

constexpr idfxx::task_priority::task_priority ( )
inlineconstexprnoexcept

Default constructor.

Initializes to priority 0 (idle).

Definition at line 87 of file cpu.hpp.

◆ task_priority() [2/2]

constexpr idfxx::task_priority::task_priority ( unsigned int  value)
inlineconstexprnoexcept

Constructs from an unsigned integer value.

Non-explicit to allow implicit conversion in designated initializers.

Parameters
valueThe priority level.

Definition at line 97 of file cpu.hpp.

Member Function Documentation

◆ operator<=>()

constexpr auto idfxx::task_priority::operator<=> ( const task_priority ) const
constexprdefaultnoexcept

Default three-way comparison.

◆ value()

constexpr unsigned int idfxx::task_priority::value ( ) const
inlineconstexprnoexcept

Returns the raw priority value.

Returns
The priority as an unsigned integer.

Definition at line 104 of file cpu.hpp.

Referenced by idfxx::to_string().


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