Manages application suspension on POSIX platforms. More...
#include <kanzi/platform/platform/suspension/win32/suspension_manager.hpp>
Public Member Functions | |
| KZ_NO_DISCARD bool | needsPolling () const |
| Checks if the platform requires polling instead of suspension. | |
| KZ_NO_DISCARD bool | needsPolling () const |
| Checks if the platform requires polling instead of suspension. | |
| SuspensionManager & | operator= (const SuspensionManager &)=delete |
| Copy assignment operator. | |
| SuspensionManager & | operator= (const SuspensionManager &)=delete |
| Copy assignment operator. | |
| SuspensionManager & | operator= (SuspensionManager &&) noexcept=delete |
| Move assignment operator. | |
| SuspensionManager & | operator= (SuspensionManager &&) noexcept=delete |
| Move assignment operator. | |
| void | setInputEvent (NativeEventHandle handle) |
| Sets the native event handle for input events. | |
| void | setInputEvent (NativeEventHandle handle) |
| Sets the native event handle for input events. | |
| void | setTaskDispatcherEvent (NativeEventHandle handle) |
| Sets the native event handle for the task dispatcher. | |
| void | setTaskDispatcherEvent (NativeEventHandle handle) |
| Sets the native event handle for the task dispatcher. | |
| void | suspend (optional< chrono::nanoseconds > timeout) |
| Suspends execution until an event occurs or timeout expires. | |
| void | suspend (optional< chrono::nanoseconds > timeout) |
| Suspends execution until an event occurs or timeout expires. | |
| SuspensionManager ()=default | |
| Constructor. | |
| SuspensionManager ()=default | |
| Constructor. | |
| SuspensionManager (const SuspensionManager &)=delete | |
| Copy constructor. | |
| SuspensionManager (const SuspensionManager &)=delete | |
| Copy constructor. | |
| SuspensionManager (SuspensionManager &&) noexcept=delete | |
| Move constructor. | |
| SuspensionManager (SuspensionManager &&) noexcept=delete | |
| Move constructor. | |
| ~SuspensionManager ()=default | |
| Destructor. | |
| ~SuspensionManager ()=default | |
| Destructor. | |
Manages application suspension on POSIX platforms.
Manages application suspension on the Win32 platform.
Suspension waits for one of these wake-up conditions:
This POSIX implementation uses posix::poll() on native file descriptors associated with the configured event handles.
Suspension waits for one of these wake-up conditions:
This Win32 implementation uses MsgWaitForMultipleObjectsEx to wait for task dispatcher events and window messages. Unlike POSIX platforms, Win32 does not use a separate input event handle as window messages are monitored automatically.
|
explicitdefault |
Constructor.
|
default |
Destructor.
|
delete |
Copy constructor.
|
deletenoexcept |
Move constructor.
|
explicitdefault |
Constructor.
|
default |
Destructor.
|
delete |
Copy constructor.
|
deletenoexcept |
Move constructor.
|
delete |
Copy assignment operator.
|
deletenoexcept |
Move assignment operator.
| void kanzi::SuspensionManager::setTaskDispatcherEvent | ( | NativeEventHandle | handle | ) |
Sets the native event handle for the task dispatcher.
| handle | The native event handle to wait on for pending tasks. |
| void kanzi::SuspensionManager::setInputEvent | ( | NativeEventHandle | handle | ) |
Sets the native event handle for input events.
| handle | The native event handle to wait on for input. |
| KZ_NO_DISCARD bool kanzi::SuspensionManager::needsPolling | ( | ) | const |
Checks if the platform requires polling instead of suspension.
| void kanzi::SuspensionManager::suspend | ( | optional< chrono::nanoseconds > | timeout | ) |
Suspends execution until an event occurs or timeout expires.
| timeout | Optional timeout duration in nanoseconds. If not set, waits indefinitely until an event occurs. |
|
delete |
Copy assignment operator.
|
deletenoexcept |
Move assignment operator.
| void kanzi::SuspensionManager::setTaskDispatcherEvent | ( | NativeEventHandle | handle | ) |
Sets the native event handle for the task dispatcher.
| handle | The native event handle to wait on for pending tasks. |
| void kanzi::SuspensionManager::setInputEvent | ( | NativeEventHandle | handle | ) |
Sets the native event handle for input events.
| handle | The native event handle to wait on for input (not used on Win32). |
| KZ_NO_DISCARD bool kanzi::SuspensionManager::needsPolling | ( | ) | const |
Checks if the platform requires polling instead of suspension.
| void kanzi::SuspensionManager::suspend | ( | optional< chrono::nanoseconds > | timeout | ) |
Suspends execution until an event occurs or timeout expires.
| timeout | Optional timeout duration in nanoseconds. If not set, waits indefinitely until an event occurs. |