|
Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
|
RAII guard for automatic callback unregistration. More...
#include <enhanced_cancellation_token.h>

Public Member Functions | |
| cancellation_callback_guard (enhanced_cancellation_token &token, std::function< void()> callback) | |
| Constructs a guard and registers the callback. | |
| ~cancellation_callback_guard () | |
| Destructor unregisters the callback. | |
| cancellation_callback_guard (const cancellation_callback_guard &)=delete | |
| auto | operator= (const cancellation_callback_guard &) -> cancellation_callback_guard &=delete |
| cancellation_callback_guard (cancellation_callback_guard &&other) noexcept | |
| Move constructor. | |
| auto | operator= (cancellation_callback_guard &&other) noexcept -> cancellation_callback_guard & |
| Move assignment. | |
Private Attributes | |
| enhanced_cancellation_token * | token_ |
| enhanced_cancellation_token::callback_handle | handle_ |
RAII guard for automatic callback unregistration.
Automatically unregisters a callback when the guard goes out of scope. Useful for ensuring callbacks are properly cleaned up.
Definition at line 358 of file enhanced_cancellation_token.h.
| kcenon::thread::cancellation_callback_guard::cancellation_callback_guard | ( | enhanced_cancellation_token & | token, |
| std::function< void()> | callback ) |
Constructs a guard and registers the callback.
| token | The token to register with. |
| callback | The callback to register. |
Definition at line 533 of file enhanced_cancellation_token.cpp.
| kcenon::thread::cancellation_callback_guard::~cancellation_callback_guard | ( | ) |
Destructor unregisters the callback.
Definition at line 540 of file enhanced_cancellation_token.cpp.
References handle_, token_, and kcenon::thread::enhanced_cancellation_token::unregister_callback().

|
delete |
|
noexcept |
Move constructor.
Definition at line 548 of file enhanced_cancellation_token.cpp.
|
noexcept |
Move assignment.
Definition at line 556 of file enhanced_cancellation_token.cpp.
|
delete |
|
private |
Definition at line 392 of file enhanced_cancellation_token.h.
Referenced by ~cancellation_callback_guard().
|
private |
Definition at line 391 of file enhanced_cancellation_token.h.
Referenced by ~cancellation_callback_guard().