|
Ersa Wearable Platform
Embedded smartwatch firmware and application framework
|
#include <power_manager.h>
Public Member Functions | |
| WakeLock (const char *tag) | |
| ~WakeLock () | |
| WakeLock (const WakeLock &)=delete | |
| WakeLock & | operator= (const WakeLock &)=delete |
| WakeLock (WakeLock &&other) noexcept | |
| WakeLock & | operator= (WakeLock &&other) noexcept |
| void | release () |
Private Attributes | |
| const char * | tag_ {nullptr} |
| bool | active_ {false} |
RAII lease that prevents automatic sleep while a feature is active. The tag is diagnostic and must remain valid until release. Scope-based use makes cleanup reliable on early returns; move operations transfer the lease without incrementing the manager's active-lock count.
|
explicit |
Acquire one sleep-prevention lease for a feature or operation.
| ersa::services::WakeLock::~WakeLock | ( | ) |
Release the lease during destruction; repeated explicit release is safe.
|
delete |
|
noexcept |
Transfer lease ownership; the moved-from object becomes inactive.
Release the current lease, then transfer the source object's lease.
| void ersa::services::WakeLock::release | ( | ) |
Release before scope exit when work completes early.
|
private |
|
private |