RADLib
RADical C++ application framework
RADPower::PowerManager Class Reference

Power manager with read-only status helpers and explicit dangerous actions. More...

#include <RADPower.h>

Public Member Functions

 PowerManager (PowerPaths paths={})
 Creates a power manager using paths. More...
 
std::vector< PowerSupplyInfopowerSupplies () const
 Lists power supplies. More...
 
std::vector< ThermalZoneInfothermalZones () const
 Lists thermal zones. More...
 
std::vector< CpuGovernorInfocpuGovernors () const
 Lists CPU governors. More...
 
bool setCpuGovernor (const std::string &cpu, const std::string &governor, std::string *error=nullptr) const
 Sets CPU governor for one CPU directory. More...
 
PowerActionPlan requestAction (PowerAction action, bool execute=false) const
 Prepares or executes a system power action. execute must be true to mutate host state. More...
 
const PowerPathspaths () const
 Returns configured paths. More...
 

Detailed Description

Power manager with read-only status helpers and explicit dangerous actions.

Constructor & Destructor Documentation

◆ PowerManager()

RADPower::PowerManager::PowerManager ( PowerPaths  paths = {})
explicit

Creates a power manager using paths.

Member Function Documentation

◆ cpuGovernors()

std::vector<CpuGovernorInfo> RADPower::PowerManager::cpuGovernors ( ) const

Lists CPU governors.

◆ paths()

const PowerPaths& RADPower::PowerManager::paths ( ) const

Returns configured paths.

◆ powerSupplies()

std::vector<PowerSupplyInfo> RADPower::PowerManager::powerSupplies ( ) const

Lists power supplies.

◆ requestAction()

PowerActionPlan RADPower::PowerManager::requestAction ( PowerAction  action,
bool  execute = false 
) const

Prepares or executes a system power action. execute must be true to mutate host state.

◆ setCpuGovernor()

bool RADPower::PowerManager::setCpuGovernor ( const std::string &  cpu,
const std::string &  governor,
std::string *  error = nullptr 
) const

Sets CPU governor for one CPU directory.

◆ thermalZones()

std::vector<ThermalZoneInfo> RADPower::PowerManager::thermalZones ( ) const

Lists thermal zones.


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