|
idfxx 1.0.0
Modern C++23 components for ESP-IDF
|
Handle for task self-interaction. More...
Public Member Functions | |
| self (const self &)=delete | |
| self & | operator= (const self &)=delete |
| bool | is_detached () const noexcept |
| Checks if the current task has been detached. | |
| bool | stop_requested () const noexcept |
| Checks if a stop has been requested for this task. | |
| void | suspend () noexcept |
| Suspends the current task. | |
| void | wait () noexcept |
| Waits for a notification (binary semaphore pattern). | |
| template<typename Rep , typename Period > | |
| bool | wait_for (const std::chrono::duration< Rep, Period > &timeout) noexcept |
| Waits for a notification with a timeout (binary semaphore pattern). | |
| template<typename Clock , typename Duration > | |
| bool | wait_until (const std::chrono::time_point< Clock, Duration > &deadline) noexcept |
| Waits for a notification until a deadline (binary semaphore pattern). | |
| uint32_t | take () noexcept |
| Takes accumulated notifications (counting semaphore pattern). | |
| template<typename Rep , typename Period > | |
| uint32_t | take_for (const std::chrono::duration< Rep, Period > &timeout) noexcept |
| Takes accumulated notifications with a timeout (counting semaphore pattern). | |
| template<typename Clock , typename Duration > | |
| uint32_t | take_until (const std::chrono::time_point< Clock, Duration > &deadline) noexcept |
| Takes accumulated notifications until a deadline (counting semaphore pattern). | |
| unsigned int | priority () const noexcept |
| Returns the current task priority. | |
| void | set_priority (unsigned int new_priority) noexcept |
| Changes the current task priority. | |
| size_t | stack_high_water_mark () const noexcept |
| Returns the minimum free stack space (in bytes) since the task started. | |
| std::string | name () const |
| Returns the current task name. | |
| TaskHandle_t | idf_handle () const noexcept |
| Returns the FreeRTOS handle of the current task. | |
Friends | |
| class | task |
Handle for task self-interaction.
Provides access to the current task's own state within the task function.
|
delete |
|
noexcept |
Returns the FreeRTOS handle of the current task.
|
noexcept |
Checks if the current task has been detached.
A detached task is self-managing: when the task function returns, the task cleans up its resources automatically.
| std::string idfxx::task::self::name | ( | ) | const |
Returns the current task name.
|
noexcept |
Returns the current task priority.
|
noexcept |
Changes the current task priority.
| new_priority | The new priority level. |
|
noexcept |
Returns the minimum free stack space (in bytes) since the task started.
This is useful for tuning stack sizes — a value approaching zero indicates potential stack overflow.
|
noexcept |
Checks if a stop has been requested for this task.
|
noexcept |
Suspends the current task.
The task will not run again until another task calls resume() on it. If a stop has been requested, this method returns immediately without suspending.
|
noexcept |
Takes accumulated notifications (counting semaphore pattern).
Blocks until at least one notification is received. Returns the number of accumulated notifications and resets the count to zero. If a stop has been requested, returns 0 immediately without waiting.
Uses notification index 0, which is reserved for this purpose.
|
inlinenoexcept |
Takes accumulated notifications with a timeout (counting semaphore pattern).
Blocks until at least one notification is received or the timeout expires. Returns the number of accumulated notifications and resets the count to zero. If a stop has been requested, returns 0 immediately without waiting.
Uses notification index 0, which is reserved for this purpose.
| Rep | The representation type of the duration. |
| Period | The period type of the duration. |
| timeout | Maximum time to wait for notifications. |
Definition at line 173 of file task.hpp.
References idfxx::chrono::ticks(), and idfxx::timeout.
|
inlinenoexcept |
Takes accumulated notifications until a deadline (counting semaphore pattern).
Blocks until at least one notification is received or the deadline is reached. Returns the number of accumulated notifications and resets the count to zero. If a stop has been requested, returns 0 immediately without waiting.
Uses notification index 0, which is reserved for this purpose.
| Clock | The clock type. |
| Duration | The duration type of the time point. |
| deadline | The time point at which to stop waiting. |
Definition at line 193 of file task.hpp.
References idfxx::chrono::ticks().
|
noexcept |
Waits for a notification (binary semaphore pattern).
Blocks until another task calls notify() or notify_from_isr(). If a stop has been requested, returns immediately without waiting.
Uses notification index 0, which is reserved for this purpose.
|
inlinenoexcept |
Waits for a notification with a timeout (binary semaphore pattern).
Blocks until a notification is received or the timeout expires. If a stop has been requested, returns immediately without waiting.
Uses notification index 0, which is reserved for this purpose.
| Rep | The representation type of the duration. |
| Period | The period type of the duration. |
| timeout | Maximum time to wait for a notification. |
Definition at line 117 of file task.hpp.
References idfxx::chrono::ticks(), and idfxx::timeout.
|
inlinenoexcept |
Waits for a notification until a deadline (binary semaphore pattern).
Blocks until a notification is received or the deadline is reached. If a stop has been requested, returns immediately without waiting.
Uses notification index 0, which is reserved for this purpose.
| Clock | The clock type. |
| Duration | The duration type of the time point. |
| deadline | The time point at which to stop waiting. |
Definition at line 136 of file task.hpp.
References idfxx::chrono::ticks().