11 #include <RADCore/RADCore.h>
94 bool setCpuGovernor(
const std::string& cpu,
const std::string& governor, std::string* error =
nullptr)
const;
Power manager with read-only status helpers and explicit dangerous actions.
Definition: RADPower.h:83
std::vector< PowerSupplyInfo > powerSupplies() const
Lists power supplies.
PowerActionPlan requestAction(PowerAction action, bool execute=false) const
Prepares or executes a system power action. execute must be true to mutate host state.
std::vector< CpuGovernorInfo > cpuGovernors() const
Lists CPU governors.
bool setCpuGovernor(const std::string &cpu, const std::string &governor, std::string *error=nullptr) const
Sets CPU governor for one CPU directory.
const PowerPaths & paths() const
Returns configured paths.
PowerManager(PowerPaths paths={})
Creates a power manager using paths.
std::vector< ThermalZoneInfo > thermalZones() const
Lists thermal zones.
Definition: RADPower.h:16
PowerAction
Guarded system power action.
Definition: RADPower.h:61
@ Shutdown
Shut down the system.
@ Reboot
Reboot the system.
@ Suspend
Suspend the system.
CPU governor snapshot.
Definition: RADPower.h:51
std::string governor
Current governor.
Definition: RADPower.h:55
std::vector< std::string > availableGovernors
Available governors.
Definition: RADPower.h:57
std::string cpu
CPU directory name.
Definition: RADPower.h:53
Prepared action result.
Definition: RADPower.h:71
std::string error
Error text when execution failed.
Definition: RADPower.h:79
std::string command
Shell command that would be executed.
Definition: RADPower.h:75
bool executed
True when command was actually executed.
Definition: RADPower.h:77
PowerAction action
Action requested.
Definition: RADPower.h:73
Filesystem roots used for power discovery.
Definition: RADPower.h:19
std::string sysClassThermal
Thermal sysfs root.
Definition: RADPower.h:23
std::string sysDevicesCpu
CPU sysfs root.
Definition: RADPower.h:25
std::string sysClassPowerSupply
Power supply sysfs root.
Definition: RADPower.h:21
Power supply snapshot.
Definition: RADPower.h:29
int capacityPercent
Capacity percent, or -1 when unknown.
Definition: RADPower.h:37
std::string type
Supply type.
Definition: RADPower.h:33
std::string name
Supply name.
Definition: RADPower.h:31
std::string status
Charging/discharging status.
Definition: RADPower.h:35
Thermal zone snapshot.
Definition: RADPower.h:41
double temperatureC
Temperature in Celsius, or NaN when unknown.
Definition: RADPower.h:47
std::string name
Zone name.
Definition: RADPower.h:43
std::string type
Zone type.
Definition: RADPower.h:45