Ersa Wearable Platform
Embedded smartwatch firmware and application framework
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
ersa::hal::PerformanceScope Class Reference

#include <power_management.h>

Collaboration diagram for ersa::hal::PerformanceScope:
Collaboration graph
[legend]

Public Member Functions

 PerformanceScope (IPowerManagement &power, PerformanceProfile profile, const char *reason)
 Acquire a workload profile and release it when this scope ends.
 
 ~PerformanceScope ()
 Release the performance profile if it was successfully acquired.
 
 PerformanceScope (const PerformanceScope &)=delete
 
PerformanceScope & operator= (const PerformanceScope &)=delete
 

Private Attributes

IPowerManagement * power_
 
PerformanceProfile profile_
 
const char * reason_
 
bool acquired_
 

Detailed Description

RAII lease that balances one performance lock on all scope exit paths.

Constructor & Destructor Documentation

◆ PerformanceScope() [1/2]

ersa::hal::PerformanceScope::PerformanceScope ( IPowerManagement &  power,
PerformanceProfile  profile,
const char *  reason 
)
inline

Acquire a workload profile and release it when this scope ends.

◆ ~PerformanceScope()

ersa::hal::PerformanceScope::~PerformanceScope ( )
inline

Release the performance profile if it was successfully acquired.

◆ PerformanceScope() [2/2]

ersa::hal::PerformanceScope::PerformanceScope ( const PerformanceScope &  )
delete

Member Function Documentation

◆ operator=()

PerformanceScope & ersa::hal::PerformanceScope::operator= ( const PerformanceScope &  )
delete

Member Data Documentation

◆ acquired_

bool ersa::hal::PerformanceScope::acquired_
private

◆ power_

IPowerManagement* ersa::hal::PerformanceScope::power_
private

◆ profile_

PerformanceProfile ersa::hal::PerformanceScope::profile_
private

◆ reason_

const char* ersa::hal::PerformanceScope::reason_
private

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